public EntityAction Update(WorkCategoryModel entity) { var category = rep.Get(entity.Id); var model = entity.ToWorkCategory(category); EntityAction result = rep.Update(model); return(result); }
public EntityAction Create(WorkCategoryModel entity) { //entity.Id = rep.GetNextId(); var model = entity.ToWorkCategory(); model.Id = rep.GetNextId(); EntityAction result = rep.Create(model); return(result); }
public WorkCategoryModel Get(int id) { var model = rep.Get(id); if (model != null) { WorkCategoryModel result = new WorkCategoryModel(model); return(result); } return(null); }
public WorkCategoryViewModel(WorkCategoryModel model) { this.Id = model.Id; this.Title = model.Title; this.Description = model.Description; this.CategoryImage = model.CategoryImage; this.KeyWord = model.KeyWord; this.ParentId = model.ParentId; this.ParentName = model.ParentName; this.Slug = model.Slug; }