예제 #1
0
        //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);
        }
예제 #2
0
 public static Z_Harag_Category ToEntity(this CategoryModel model, Z_Harag_Category destination)
 {
     return(model.MapTo(destination));
 }
예제 #3
0
 public static CategoryModel ToCategoryModel(this Z_Harag_Category entity)
 {
     return(entity.MapTo <Z_Harag_Category, CategoryModel>());
 }