Ejemplo n.º 1
0
        public async Task <IHttpActionResult> Delete([FromODataUri] int StateProvinceID)
        {
            var item = await _service.FindAsync(StateProvinceID);

            if (item == null)
            {
                return(NotFound());
            }

            item.ObjectState = ObjectState.Deleted;

            _service.Delete(item);
            await _unitOfWorkAsync.SaveChangesAsync();

            return(StatusCode(HttpStatusCode.NoContent));
        }