public SpolView MapSpolToBasicSpol(Spol spol) { var result = new SpolView { Id = spol.Id, Naziv = spol.Naziv }; return(result); }
public Spol MapSpolViewToSpol(SpolView view) { var result = new Spol() { Id = view.Id, Naziv = view.Naziv }; return(result); }
// PUT: api/spol/5 public IHttpActionResult Put([FromBody] SpolView spol) { var model = _mapper.MapSpolViewToSpol(spol); var result = _service.UpdateSpol(model); if (result) { return(Ok(result)); } else { return(InternalServerError()); } }