Пример #1
0
        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);
            }
        }
Пример #3
0
 public decimal CalculateDiscount(Product p)
 {
     return p.Discount();
 }