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

            this.categoryId = model.category.id;
        }
Exemplo n.º 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;
        }
Exemplo n.º 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;
 }