Example #1
0
        public static DomainResult Failure(HttpStatusCode code, string error)
        {
            var failure = new DomainResult(false);

            if (!string.IsNullOrWhiteSpace(error))
            {
                failure._errorMessage = new KeyValuePair <HttpStatusCode, string>(code, error);
            }

            return(failure);
        }
Example #2
0
 public static BaseResponse Failure(HttpStatusCode code, string error) =>
 new BaseResponse()
 {
     Result = DomainResult.Failure(code, error)
 };
Example #3
0
 public static T Failure <T>(HttpStatusCode code, string error) where T : BaseResponse, new() =>
 new T
 {
     Result = DomainResult.Failure(code, error)
 };