public static ResponseViewModel <T> GetErrorResult(ResponseResultTypes resultType, string message) { List <string> exceptions = new List <string> { message }; return(GetResult(resultType, message, null, exceptions)); }
public static ResponseViewModel <T> GetResult(ResponseResultTypes type, string message, T data, IList <string> errors) { ResponseViewModel <T> response = new ResponseViewModel <T> { StatusCode = $"{(int)type}", Message = message, Data = data, Errors = errors }; return(response); }
public static ResponseViewModelWithAction <T> GetResult(ResponseResultTypes type, string message, T data, IList <string> errors, bool isRestore) { ResponseViewModelWithAction <T> response = new ResponseViewModelWithAction <T> { StatusCode = $"{(int)type}", Message = message, Data = data, Errors = errors, ActionRequired = isRestore }; return(response); }