Ejemplo n.º 1
0
        /// <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;
        }
Ejemplo n.º 2
0
        /// <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;
        }