public int PostFullFoodAndGeoData(FullFoodAndGeoData fullFoodAndGeoData, User user) { CompleteFoodDataDTO completeFoodDataDTO = _mapper.Map<CompleteFoodDataDTO>(fullFoodAndGeoData); UserDTO userDTO = _mapper.Map<UserDTO>(user); int id = _completeFoodDataRepo.Post(completeFoodDataDTO, userDTO); return id; }
public PostedFoodMarkerRetObj Post([FromBody] FullFoodAndGeoDataClient reqObj) { if (reqObj == null) { BadRequest(); } int id = (int)RouteData.Values["UserId"]; User user = new User() { Id = id }; FullFoodAndGeoData model = _mapper.Map <FullFoodAndGeoData>(reqObj); return(new PostedFoodMarkerRetObj { Id = _service.PostFullFoodAndGeoData(model, user) }); }