// See the attribute guidelines at // http://go.microsoft.com/fwlink/?LinkId=85236 public ServiceResultMetadataAttribute(ResultOutcome success, ResultCategory category, int httpStatusCode) { Outcome = success; Category = category; HttpStatusCode = httpStatusCode; if (success == ResultOutcome.Successful && category != ResultCategory.Successful) { throw new ArgumentException("If successful then the category must also be successful", nameof(category)); } }
public static UseCaseResult Fail( IEnumerable <ValidationFailure> errors = null, ResultCategory resultCategory = ResultCategory.GeneralFailure) => new UseCaseResult(errors, resultCategory);