public IActionResult ChangeProfile(ProfileFullView view) { var mapConfig = new MapperConfiguration(cfg => cfg.CreateMap <ProfileFullView, Profile>()); var mapper = new Mapper(mapConfig); var resultFromHandler = requestHandler.Change(view.Id.Value, mapper.Map <Profile>(view)); // проверка на null? return(ApiResultGenerator.GenerateResult(resultFromHandler)); }
public IActionResult CreateProfile(ProfileFullView view) { var mapConfig = new MapperConfiguration(cfg => cfg.CreateMap <ProfileFullView, Profile>()); var mapper = new Mapper(mapConfig); var resultFromHandler = requestHandler.Add(mapper.Map <Profile>(view)); return(ApiResultGenerator.GenerateResult(resultFromHandler)); }