public void UpdateCategory(Model.Category category, int categoryId) { var tableCategory = context.Categorys.Find(categoryId); tableCategory.name = category.Name; tableCategory.category_id = category.CategoryId; context.SaveChanges(); }
public static Table.Category Map(this Model.Category category) { var tableCategory = new Table.Category { name = category.Name }; return(tableCategory); }
public static Model.Category Map(this Table.Category category, int filmCount = 0) { var domainCategory = new Model.Category { CategoryId = category.category_id, FilmCount = filmCount, Name = category.name, lastUpdate = category.last_update }; return(domainCategory); }
public static Model.Category Map(this Table.Category category, int filmCount = 0) { var domainCategory = new Model.Category { CategoryId = category.category_id, FilmCount = filmCount, Name = category.name, lastUpdate = category.last_update }; return domainCategory; }
public void AddCategory(Model.Category category) { context.Categorys.Add(category.Map()); }