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