Exemple #1
0
        private static async Task <EmailObjectDto> GetEmail(string @event,
                                                            Language language, IQueryBus queryBus, CancellationToken token)
        {
            var query     = new GetEmailByEventQuery(@event);
            var template2 = await queryBus.QueryAsync(query, token);

            if (template2 == null)
            {
                return(null);
            }


            CultureInfo info         = language;
            var         emailObjects = template2.ToList();

            while (info != null)
            {
                var template1 = emailObjects.FirstOrDefault(f => f.CultureInfo.Equals(info));
                if (template1 != null)
                {
                    return(template1);
                }

                if (Equals(info, info.Parent))
                {
                    break;
                }
                info = info.Parent;
            }

            var z        = (CultureInfo)Language.English;
            var template = emailObjects.FirstOrDefault(f => f.CultureInfo.Equals(z));

            return(template);
        }
Exemple #2
0
 public async Task GetEmailByEventQuery_Ok()
 {
     var query = new GetEmailByEventQuery("DocumentPurchased");
     var _     = await fixture.QueryBus.QueryAsync(query, default);
 }