Пример #1
0
 public ProductsPage( Category category, Subcategory subcategory )
 {
     this.category = category;
     this.subcategory = subcategory;
     System.Diagnostics.Debug.WriteLine ( category.ToString() + " " + subcategory.ToString() );
     InitializeComponents ().ConfigureAwait(false);
 }
Пример #2
0
        public async Task EditSubcategory(Subcategory subcategory)
        {
            var subcategories = await context.Subcategories.FindAsync((Guid)subcategory.Id);

            if (subcategories != null)
            {
                subcategories.Name = subcategory.ToString();
                context.Entry(subcategories).State = EntityState.Modified;
            }
        }
Пример #3
0
        public void AddSubcategory(Subcategory subcategory)
        {
            var subcategories = new Subcategories()
            {
                Id       = subcategory.Id,
                Category = subcategory.Category,
                Name     = subcategory.ToString()
            };

            context.Subcategories.Add(subcategories);
        }