public ActionResult Create(CountryInput input) { if (ModelState.IsValid) { var country = mapper.Map <CountryInput, Country>(input); var id = countryService.Create(country); country = countryService.Get(id); return(Json(new { Item = country })); } return(Json(ModelState.GetErrorsInline())); }
public virtual ActionResult Create() { return(View(mapper.Map <TEntity, TCreateInput>(new TEntity()))); }
public void CreateShouldBuildNewInput() { c.Create(); A.CallTo(() => mapper.Map <Country, CountryInput>(A <Country> .Ignored, null)).MustHaveHappened(); }