Esempio n. 1
0
        //Add category
        public Z_Consultant_Category AddCategory(CategoryModelForPost category)
        {
            var categoryDb = new Z_Consultant_Category
            {
                Name        = category.Name,
                DateCreated = DateTime.Now,
                DateUpdated = DateTime.Now,
                Description = category.Description,
                IsActive    = category.IsActive
            };

            if (categoryDb != null)
            {
                _categoryRepository.Insert(categoryDb);
            }
            return(categoryDb);
        }
 public static Z_Consultant_Category ToEntity(this CategoryWithSubCategoriesModel model, Z_Consultant_Category destination)
 {
     return(model.MapTo(destination));
 }
 public static CategoryWithSubCategoriesModel ToCategoryWithSubCategoriesModel(this Z_Consultant_Category entity)
 {
     return(entity.MapTo <Z_Consultant_Category, Models.Consultant.Category.CategoryWithSubCategoriesModel>());
 }
 public static CategoryModel ToCategoryModel(this Z_Consultant_Category entity)
 {
     return(entity.MapTo <Z_Consultant_Category, CategoryModel>());
 }