Exemplo n.º 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);
        }
Exemplo n.º 2
0
 public static BaseResponse Failure(HttpStatusCode code, string error) =>
 new BaseResponse()
 {
     Result = DomainResult.Failure(code, error)
 };
Exemplo n.º 3
0
 public static T Failure <T>(HttpStatusCode code, string error) where T : BaseResponse, new() =>
 new T
 {
     Result = DomainResult.Failure(code, error)
 };