Skip to content

Instantly share code, notes, and snippets.

View ilkerhalil's full-sized avatar
🏠
Working from home

Ilker Halil Turer ilkerhalil

🏠
Working from home
View GitHub Profile

Keybase proof

I hereby claim:

  • I am ilkerhalil on github.
  • I am ilkerhalil (https://keybase.io/ilkerhalil) on keybase.
  • I have a public key ASCq7xYiMJ1xiG_h5MrYVGVcuziAdKu0uBxZ5SSrFWR9zgo

To claim this, I am signing this object:

<?xml version="1.0" encoding="UTF-8"?>
<xBusinessRules xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="xbusinessRules.xsd">
<Decimal id="10YearMemberDiscount" value="0.03"/>
<Decimal id="5YearMemberDiscount" value="0.02"/>
<Decimal id="BirthDateDiscount" value="0.01"/>
<Decimal id="TotalIncome10000" value="10000"/>
<Decimal id="TotalIncome50000" value="50000"/>
public class CalculateDiscount
{
private readonly IFlowEngine _flowEngine;
private const string AXmlFile = "Discount.xbre";
public CalculateDiscount(Basket basket)
{
_flowEngine = new BREFactoryConsole(SourceLevels.Error, SourceLevels.All).NewBRE(new XBusinessRulesFileDriver(AXmlFile));
if (_flowEngine == null) throw new Exception("BRE Not Properly Initialized!");
_flowEngine.RuleContext.SetObject("currentBasket", basket);
namespace NxBRE_BlogSample.After
{
public class Customer
{
public string Name { get; set; }
public string SurName { get; set; }
public string FullName
{
get { return $"{Name} {SurName}"; }
using System;
using System.Collections.Generic;
namespace NxBRE_BlogSample
{
internal static class Program
{
private static void Main(string[] args)
{
using System;
namespace CustomConfigSectionForT4
{
class Program
{
static void Main()
{
SmsSender smsSender = new SmsSender();
smsSender.SendSms("+90544*******","Merhaba");
using System;
using System.Configuration;
using System.Linq;
using CustomConfigSectionForT4.ConfigSection;
namespace CustomConfigSectionForT4
{
public class SmsSender
{
public string UserName { get; set; }
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="SmsSenderConfigSection" type="CustomConfigSectionForT4.ConfigSection.SmsSenderConfigSection,CustomConfigSectionForT4" />
</configSections>
<SmsSenderConfigSection
UserName="example value" Password="example value" MsIsdn="example value" >
<ForbiddenNumbers>
<add value="+90535*******" />
</ForbiddenNumbers>
namespace CustomConfigSectionForT4.ConfigSection
{
using System;
using System.Configuration;
/*
Add the code your app.config or web.config
<configSections>
<section name="SmsSenderConfigSection" type="CustomConfigSectionForT4.ConfigSection.SmsSenderConfigSection,CustomConfigSectionForT4" />
</configSections>
<#@ template debug="false" hostspecific="false" language="C#" #>
<#@ assembly name="System.Core" #>
<#@ import namespace="Microsoft.VisualStudio.TextTemplating" #>
<#+
public class CustomCollectionSectionManager:TextTransformation
{
public override string TransformText()
{
#>