6.1.4: e.g. 6.11 Using a Constructor Property in an Implementation Class
This commit is contained in:
parent
d597a410d4
commit
390cf4555c
@ -35,10 +35,16 @@ namespace NinjectDemo
|
|||||||
|
|
||||||
public class DefaultDiscountHelper : IDiscountHelper
|
public class DefaultDiscountHelper : IDiscountHelper
|
||||||
{
|
{
|
||||||
public decimal DiscountSize { get; set; }
|
private decimal discountRate;
|
||||||
|
|
||||||
|
public DefaultDiscountHelper(decimal discountParam)
|
||||||
|
{
|
||||||
|
discountRate = discountParam;
|
||||||
|
}
|
||||||
|
|
||||||
public decimal ApplyDiscount(decimal totalParam)
|
public decimal ApplyDiscount(decimal totalParam)
|
||||||
{
|
{
|
||||||
return (totalParam - (DiscountSize * totalParam));
|
return (totalParam - (discountRate / 100m * totalParam));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user