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

            try
            {
                MakeProcessor.Find();
                Response.text   = JsonConverter.JsonConverter.ObjToJson(MakeProcessor.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)
        {
            MakeProcessor = new MakeProcessor();
            Response      = new ApiResponse();

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

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

                return(Response);
            }
        }