Ejemplo n.º 1
0
        public async Task <IActionResult> Delete(
            [HttpTrigger(AuthorizationLevel.Anonymous, HttpVerbs.DELETE, Route = "Community")] HttpRequest req,
            ILogger log)
        {
            await communityService.DeleteAsync(req.Query["Id"].ToString());

            return(new OkResult());
        }
Ejemplo n.º 2
0
        public async Task <IHttpActionResult> Delete(int id)
        {
            try
            {
                var result = await _communityService.DeleteAsync(id);

                if (result.Status == ActionStatus.Deleted)
                {
                    return(StatusCode(HttpStatusCode.NoContent));
                }
                else if (result.Status == ActionStatus.NotFound)
                {
                    return(NotFound());
                }

                return(BadRequest());
            }
            catch (Exception)
            {
                return(InternalServerError());
            }
        }