예제 #1
0
        public void AddFigure(FigureBm model)
        {
            var entityFigure = Mapper.Map <FigureBm, Figure>(model);

            this.figures.Add(entityFigure);
            this.figures.SaveChanges();
        }
        public ActionResult Add(FigureBm model)
        {
            if (this.ModelState.IsValid)
            {
                this.service.AddFigure(model);
                return(this.RedirectToAction("All", "AdminPosts"));
            }

            return(this.View());
        }