public static void Main(string[] args) { var calc = new Calculator(); var product = new Product() { Price = 49 }; Console.WriteLine(calc.CalculateDiscount(product)); Console.ReadLine(); }
private void btnCreateSession_Click(object sender, RoutedEventArgs e) { var factory = CreateSessionFactory(); using (var session = factory.OpenSession()) { var category = new Category { Name = "Beverages", Description = "Some Description" }; var product = new Product { Name= "Milk", Category = category }; session.Save(category); session.Save(product); } }
public decimal CalculateDiscount(Product p) { return p.Discount(); }