public ApiResponse ListAll() { UserGroupProcessor = new UserGroupProcessor(); Response = new ApiResponse(); try { UserGroupProcessor.Find(); Response.text = JsonConverter.JsonConverter.ObjToJson(UserGroupProcessor.Find()); Response.result = true; return(Response); } catch { Response.text = "Unfortunately something went wrong :("; Response.result = false; return(Response); } }
public ApiResponse FindByPK(long id) { UserGroupProcessor = new UserGroupProcessor(); Response = new ApiResponse(); try { UserGroupProcessor.Find(id); Response.text = "Account with this PK has been found" + Environment.NewLine + JsonConverter.JsonConverter.ObjToJson(UserGroupProcessor.Find(id)); Response.result = true; return(Response); } catch { Response.text = "An account with this id does not exist"; Response.result = false; return(Response); } }