/// <inheritdoc/> public string ToDelimitedString() { CultureInfo culture = CultureInfo.CurrentCulture; return(string.Format( culture, StringHelper.StringFormatSequence(0, 13, Configuration.FieldSeparator), Id, ErrorCodeAndLocation, ErrorLocation != null ? string.Join(Configuration.FieldRepeatSeparator, ErrorLocation.Select(x => x.ToDelimitedString())) : null, Hl7ErrorCode?.ToDelimitedString(), Severity, ApplicationErrorCode?.ToDelimitedString(), ApplicationErrorParameter != null ? string.Join(Configuration.FieldRepeatSeparator, ApplicationErrorParameter) : null, DiagnosticInformation?.ToDelimitedString(), UserMessage?.ToDelimitedString(), InformPersonIndicator != null ? string.Join(Configuration.FieldRepeatSeparator, InformPersonIndicator.Select(x => x.ToDelimitedString())) : null, OverrideType?.ToDelimitedString(), OverrideReasonCode != null ? string.Join(Configuration.FieldRepeatSeparator, OverrideReasonCode.Select(x => x.ToDelimitedString())) : null, HelpDeskContactPoint != null ? string.Join(Configuration.FieldRepeatSeparator, HelpDeskContactPoint.Select(x => x.ToDelimitedString())) : null ).TrimEnd(Configuration.FieldSeparator.ToCharArray())); }
public void AddError(ApplicationErrorCode errorCode, params object[] args) { Errors.Add(string.Format(errorCode.GetDescription(), args)); IsSuccess = false; }
public static ApplicationResult <T> Fail <T>(ApplicationErrorCode errorCode, params object[] args) { return(new ApplicationResult <T>(default(T), false, new List <string> { string.Format(errorCode.GetDescription(), args) })); }
/// <summary> /// Creates an ApplicationErrorArgs. /// </summary> /// <param name="code">The code for the error.</param> /// <param name="text">A textual representation of the error.</param> public ApplicationErrorArgs(ApplicationErrorCode code, string text) { _code = code; _text = text; }