public void Add(PostBrochureViewModel brochureView) { Brochure brochure = Mapper.Map <PostBrochureViewModel, Brochure>(brochureView); brochure.PublicationType = PublicationType.Brochure; _brochureRepository.Add(brochure); }
public IActionResult Put(int id, [FromBody] PostBrochureViewModel brochure) { if (ModelState.IsValid) { _brochureService.Edit(brochure); return(Ok(brochure)); } return(BadRequest(ModelState)); }
private Brochure ToBrochure(PostBrochureViewModel brochureViewModel) { return(Mapper.Map <PostBrochureViewModel, Brochure>(brochureViewModel)); }
public void Edit(PostBrochureViewModel brochureViewModel) { _brochureRepository.Update(ToBrochure(brochureViewModel)); }
public void Add(PostBrochureViewModel brochureViewModel) { _brochureRepository.Add(ToBrochure(brochureViewModel)); }
public IActionResult Post([FromBody] PostBrochureViewModel brochure) { _brochureService.Add(brochure); return(Ok()); }