Beispiel #1
0
        public ApiResponse ListAll()
        {
            VehicleProcessor = new VehicleProcessor();
            Response         = new ApiResponse();

            try
            {
                VehicleProcessor.Find();
                Response.text   = JsonConverter.JsonConverter.ObjToJson(VehicleProcessor.Find());
                Response.result = true;

                return(Response);
            }
            catch
            {
                Response.text   = "Unfortunately something went wrong :(";
                Response.result = false;

                return(Response);
            }
        }
Beispiel #2
0
        public ApiResponse FindByPK(long id)
        {
            VehicleProcessor = new VehicleProcessor();
            Response         = new ApiResponse();

            try
            {
                VehicleProcessor.Find(id);
                Response.text   = "Account with this PK has been found" + Environment.NewLine + JsonConverter.JsonConverter.ObjToJson(VehicleProcessor.Find(id));
                Response.result = true;

                return(Response);
            }
            catch
            {
                Response.text   = "An account with this id does not exist";
                Response.result = false;

                return(Response);
            }
        }