//Add Category public bool AddCategory(PostCategoryModel category) { var categoryInDb = new Z_Harag_Category { Name = category.Name, Description = category.Description, IsActive = category.IsActive, DateCreated = DateTime.Now }; if (categoryInDb != null) { _categoryRepository.Insert(categoryInDb); return(true); } return(false); }
public static Z_Harag_Category ToEntity(this CategoryModel model, Z_Harag_Category destination) { return(model.MapTo(destination)); }
public static CategoryModel ToCategoryModel(this Z_Harag_Category entity) { return(entity.MapTo <Z_Harag_Category, CategoryModel>()); }