public CategoryInputView(CategoryInput model)
        {
            Mapper.CreateMap<CategoryInput, CategoryInputView>();
            Mapper.Map<CategoryInput, CategoryInputView>(model, this);

            this.categoryId = model.category.id;
        }
Example #2
0
        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;
        }
Example #4
0
        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;
 }