public static AdvertType MapAdvertType(AdvertConfirmedMessage message)
 {
     return(new AdvertType
     {
         CreationTime = DateTime.UtcNow,
         Id = message.Id,
         Title = message.Title,
     });
 }
Esempio n. 2
0
        public static AdvertType Map(AdvertConfirmedMessage message)
        {
            AdvertType doc = new AdvertType()
            {
                Id               = message.Id,
                Title            = message.Title,
                CreationDateTime = DateTime.UtcNow
            };

            return(doc);
        }
Esempio n. 3
0
        public static AdvertType Map(AdvertConfirmedMessage message)
        {
            var type = new AdvertType
            {
                Id               = message.Id,
                Title            = message.Title,
                CreationDateTime = DateTime.UtcNow
            };

            return(type);
        }
Esempio n. 4
0
        public static AdvertType Map(AdvertConfirmedMessage message)
        {
            var doc = new AdvertType
            {
                Id       = message.Id,
                Title    = message.Title,
                Creation = DateTime.Now
            };

            return(doc);
        }
        public static AdvertMessageModel Map(AdvertConfirmedMessage model)
        {
            var doc = new AdvertMessageModel
            {
                Id           = model.Id,
                Title        = model.Title,
                CreationDate = DateTime.UtcNow
            };

            return(doc);
        }
Esempio n. 6
0
        public async Task Function(SNSEvent snsEvent, ILambdaContext context)
        {
            foreach (var record in snsEvent.Records)
            {
                context.Logger.LogLine(record.Sns.Message);

                AdvertConfirmedMessage message        = JsonConvert.DeserializeObject <AdvertConfirmedMessage>(record.Sns.Message);
                AdvertType             advertDocument = MappingHelper.Map(message);
                await _elasticClient.IndexDocumentAsync(advertDocument);
            }
        }