document.write("
public class BMIProcessor : PolicyInjectionComponentBase
{
public int Weight { get; set; }
public int Height { get; set; }
public Decimal BMI
{
get
{
return Calculate();
}
}
[ExceptionNotify(LogFileName = "log.txt")]
[Logging(LogFileName = "log.txt")]
//計算BMI
public Decimal Calculate()
{
Decimal result = 0;
Decimal height = (Decimal)Height / 100;
result = Weight / (height * height);
return result;
}
}
BMIProcessor.cs - Snippet hosted by \"Cacher\"
");