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()));
        }
Ejemplo n.º 2
0
 public virtual ActionResult Create()
 {
     return(View(mapper.Map <TEntity, TCreateInput>(new TEntity())));
 }
Ejemplo n.º 3
0
 public void CreateShouldBuildNewInput()
 {
     c.Create();
     A.CallTo(() => mapper.Map <Country, CountryInput>(A <Country> .Ignored, null)).MustHaveHappened();
 }