/// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { DeleteMethodResponse response = new DeleteMethodResponse(); return(response); }
/// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { DeleteMethodResponse response = new DeleteMethodResponse(); return response; }
public DeleteMethodResponse Delete(int id) { var response = new DeleteMethodResponse(); try { var method = new Method { Id = id }; DataContext.Methods.Attach(method); DataContext.Entry(method).State = EntityState.Deleted; DataContext.SaveChanges(); response.IsSuccess = true; response.Message = "Method item has been deleted successfully"; } catch (DbUpdateException dbUpdateException) { response.Message = dbUpdateException.Message; } return response; }
public DeleteMethodResponse Delete(int id) { var response = new DeleteMethodResponse(); try { var method = new Method { Id = id }; DataContext.Methods.Attach(method); DataContext.Entry(method).State = EntityState.Deleted; DataContext.SaveChanges(); response.IsSuccess = true; response.Message = "Method item has been deleted successfully"; } catch (DbUpdateException dbUpdateException) { response.Message = dbUpdateException.Message; } return(response); }