public DispatchEmailResponse(DispatchEmailRequest request, string[] errors) { Debug.Assert(request != null); Debug.Assert(errors != null); this.IsSuccess = errors.Length > 0; this.Request = request; this.Errors = errors; }
public async Task <DispatchEmailResponse> Dispatch(DispatchEmailRequest request) { var result = DispatchEmailResponse.CreateFailed(request); //Overload CreateFailed try { if (!request.IsValid()) { result = DispatchEmailResponse.CreateFailed(request, request.GetErrors()); } else { result = await this._dispatcher.Dispatch(request); } } catch (Exception e) { throw new EmailDispatcherException(e); } return(result); }
public static DispatchEmailResponse CreateFailed(DispatchEmailRequest request, string[] errors) { Console.WriteLine("Create Failed method (overload): DispatchEmailResponse "); throw new NotImplementedException(); }
//internal static object / Temporary return data, Add to extensions public static DispatchEmailResponse CreateFailed(DispatchEmailRequest request) { Console.WriteLine("Create Failed method: DispatchEmailResponse "); throw new NotImplementedException(); }
//Constructors public DispatchEmailResponse(DispatchEmailRequest request) : this(request, new string[] { }) { Console.WriteLine("DispatchEmailResponse method (overload): DispatchEmailResponse "); //sendGrid application here }