Esempio n. 1
0
 public ProcessStatus(ProcessStatusCodes code, string name, string description, string letter)
 {
     Code        = code;
     Name        = name;
     Description = description;
     Letter      = letter;
 }
        public static ResponseModel <T> Create(T data, ProcessStatusCodes processStatus = ProcessStatusCodes.Success, FriendlyMessageModel friendlyMessage = null)
        {
            var response = new ResponseModel <T>
            {
                Data            = data,
                ProcessStatus   = ProcessStatusModel.Create(processStatus),
                FriendlyMessage = friendlyMessage
            };

            return(response);
        }
        public static ResponseModel <object> CreateMessageInData(T data, ProcessStatusCodes processStatus = ProcessStatusCodes.Success, FriendlyMessageModel message = null, FriendlyMessageModel friendlyMessage = null)
        {
            var resultObject = new MessageInData <T> {
                Response = data, Message = message
            };
            var response = new ResponseModel <object>
            {
                Data            = resultObject,
                ProcessStatus   = ProcessStatusModel.Create(processStatus),
                FriendlyMessage = friendlyMessage
            };

            return(response);
        }
        public static ResponseModel <System.Exception> CreateException(System.Exception ex, ProcessStatusCodes processStatus, FriendlyMessageModel friendlyMessage = null)
        {
            var response = new ResponseModel <System.Exception>
            {
                Data            = ex,
                ProcessStatus   = ProcessStatusModel.Create(processStatus),
                FriendlyMessage = friendlyMessage
            };

            return(response);
        }
 public static ResponseModel <object> Create(ProcessStatusCodes processStatus = ProcessStatusCodes.Success, FriendlyMessageModel friendlyMessage = null)
 {
     return(ResponseModel <object> .Create(null, processStatus, friendlyMessage));
 }
 public static ProcessStatusModel Create(ProcessStatusCodes processStatusCode)
 {
     return(new ProcessStatusModel {
         ProcessStatusCode = processStatusCode
     });
 }