Ejemplo n.º 1
0
        public IHttpActionResult PostPropertyService(PropertyServiceViewModel service)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            serviceRepository.UpdatePropertyService(service.MapTo <PropertyService>());

            return(Ok(service));
        }
Ejemplo n.º 2
0
        public IHttpActionResult PutPropertyService(int id, PropertyServiceViewModel service)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != service.Id)
            {
                return(BadRequest());
            }

            serviceRepository.UpdatePropertyService(service.MapTo <PropertyService>());

            return(StatusCode(HttpStatusCode.NoContent));
        }