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