public CategoryInputView(CategoryInput model) { Mapper.CreateMap<CategoryInput, CategoryInputView>(); Mapper.Map<CategoryInput, CategoryInputView>(model, this); this.categoryId = model.category.id; }
public CategoryInputView(CategoryInput model) { Mapper.CreateMap <CategoryInput, CategoryInputView>(); Mapper.Map <CategoryInput, CategoryInputView>(model, this); this.categoryId = model.category.id; }
public CategoryInput getModel(IRepository repo) { var model = new CategoryInput(); Mapper.CreateMap<CategoryInputView, CategoryInput>(); Mapper.Map<CategoryInputView, CategoryInput>(this, model); model.category = repo.getCategory(this.categoryId); return model; }
public CategoryInput getModel(IRepository repo) { var model = new CategoryInput(); Mapper.CreateMap <CategoryInputView, CategoryInput>(); Mapper.Map <CategoryInputView, CategoryInput>(this, model); model.category = repo.getCategory(this.categoryId); return(model); }
public CategoryInput createCategoryInput(CategoryInput model) { db.categoryInputs.Add(model); db.SaveChanges(); return model; }