Пример #1
0
        static void Main(string[] args)
        {
            ProductDbObject product1 = new ProductDbObject()
            {
                Category = new CategoryDbObject()
                {
                    Name       = "Pizza",
                    PrimaryKey = new Guid()
                },
                Name       = "JakasTam",
                PrimaryKey = new Guid()
            };

            CategoryDbObject PizzaCategory = new CategoryDbObject()
            {
                Name       = "Pizza",
                PrimaryKey = new Guid()
            };


            CategoryService catgeService = new CategoryService(new HtcEfDbContext());

            catgeService.AddEntity(PizzaCategory);
            catgeService.SaveChange();
        }
Пример #2
0
        static void Main(string[] args)
        {
            ProductDbObject product1 = new ProductDbObject()
            {
                Category = new CategoryDbObject()
                {
                    Name = "Pizza",
                    PrimaryKey = new Guid()
                },
                Name = "JakasTam",
                PrimaryKey = new Guid()
            };

            CategoryDbObject PizzaCategory = new CategoryDbObject()
            {
                Name = "Pizza",
                PrimaryKey = new Guid()
            };

            CategoryService catgeService = new CategoryService(new HtcEfDbContext());
            catgeService.AddEntity(PizzaCategory);
            catgeService.SaveChange();
        }