Ejemplo n.º 1
0
        // DELETE api/user/5
        public bool Delete(long id)
        {
            ServiceResponse <User> Response = _userRepository.Delete(id);

            if (Response.Error)
            {
                throw new HttpResponseException(this.Request.CreateErrorResponse(HttpStatusCode.BadRequest, Response.Message));
            }
            return(true);
        }
Ejemplo n.º 2
0
 public IHttpActionResult DeleteUser(int id)
 {
     if (ModelState.IsValid)
     {
         try
         {
             bl.Delete(id);
         }
         catch (Exception)
         {
             return(Ok("Error is occured during deleted !"));
         }
         return(Ok("Record is deleted Sucessfully !"));
     }
     return(Ok());
 }