/// <summary> /// Toes the category view model. /// </summary> /// <param name="category">The category.</param> /// <returns>New Category View Model</returns> public static CategoryViewModel CategoryToCategoryViewModel(Category category) { CategoryViewModel model = new CategoryViewModel { CategoryId = category.CategoryId, Title = category.Title, Username = category.Username }; return model; }
/// <summary> /// Froms the category view model. /// </summary> /// <param name="model">The model.</param> /// <returns>New Category</returns> public static Category CategoryViewModelToCategory(CategoryViewModel model) { Category category = new Category { CategoryId = model.CategoryId, Title = model.Title, Username = model.Username }; return category; }