Exemplo n.º 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;
 }
Exemplo n.º 2
0
 private CvrtCategory(Category domain)
     : base(domain)
 {
 }
Exemplo n.º 3
0
 public static Db.Category ToDb(Category domain, Db.Category db)
 {
     return CvrtCategory.ConvertToDatabase(domain, db);
 }
Exemplo n.º 4
0
 public void Delete(Category domain)
 {
     context.Categories.Where(i => i.Id == domain.Id).Delete();
     context.SaveChanges();
 }
Exemplo n.º 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();
 }
Exemplo n.º 6
0
 protected Category(Category category)
     : this(category.DepartmentId, category.Name, category.Description, category.ImageUrl, category.Id, category.Products)
 {
 }