コード例 #1
0
        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;
        }
コード例 #2
0
        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);
        }
コード例 #3
0
 public static DispatchEmailResponse CreateFailed(DispatchEmailRequest request, string[] errors)
 {
     Console.WriteLine("Create Failed method (overload): DispatchEmailResponse ");
     throw new NotImplementedException();
 }
コード例 #4
0
 //internal static object / Temporary return data, Add to extensions
 public static DispatchEmailResponse CreateFailed(DispatchEmailRequest request)
 {
     Console.WriteLine("Create Failed method: DispatchEmailResponse ");
     throw new NotImplementedException();
 }
コード例 #5
0
        //Constructors

        public DispatchEmailResponse(DispatchEmailRequest request) : this(request, new string[] { })
        {
            Console.WriteLine("DispatchEmailResponse method (overload): DispatchEmailResponse ");
            //sendGrid application here
        }