Beispiel #1
0
        public SpolView MapSpolToBasicSpol(Spol spol)
        {
            var result = new SpolView
            {
                Id    = spol.Id,
                Naziv = spol.Naziv
            };

            return(result);
        }
Beispiel #2
0
        public Spol MapSpolViewToSpol(SpolView view)
        {
            var result = new Spol()
            {
                Id    = view.Id,
                Naziv = view.Naziv
            };

            return(result);
        }
Beispiel #3
0
        // 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());
            }
        }