Example #1
0
 public static Db.Category ConvertToDatabase(Category dmn, Db.Category db)
 {
     //CvrtCategory domain = new CvrtCategory(dmn);
     //db.DepartmentId = domain.DepartmentId;
     //db.Name = domain.Name;
     //db.Description = domain.Description;
     //db.ImageUrl = domain.ImageUrl;
     return db;
 }
Example #2
0
 private CvrtCategory(Category domain)
     : base(domain)
 {
 }
Example #3
0
 public static Db.Category ToDb(Category domain, Db.Category db)
 {
     return CvrtCategory.ConvertToDatabase(domain, db);
 }
Example #4
0
 public void Delete(Category domain)
 {
     context.Categories.Where(i => i.Id == domain.Id).Delete();
     context.SaveChanges();
 }
Example #5
0
 public void Save(Category domain)
 {
     //Db.Category db = context.Categories.FirstOrDefault(i => i.Id == domain.Id);
     //if (db == null)
     //{
     //    db = new Db.Category();
     //    context.Categories.Add(db);
     //}
     //ProductsConverter.ToDb(domain, db);
     context.SaveChanges();
 }
Example #6
0
 protected Category(Category category)
     : this(category.DepartmentId, category.Name, category.Description, category.ImageUrl, category.Id, category.Products)
 {
 }