Esempio n. 1
0
        /// <summary>
        /// Add or update the document
        /// Calls the base class because there may be some generic behavior in it
        /// </summary>
        /// <typeparam name="T">generic type</typeparam>
        /// <param name="listModels">list generic models</param>
        /// <returns>The upserted Entity</returns>
        public override async Task <IEnumerable <T> > AddOrUpdateAsync <T>(List <T> listModels)
        {
            await base.AddOrUpdateAsync(listModels);

            var itemBatch = DynamoDbContext.CreateBatchWrite <T>();

            listModels.ToList().ForEach(x => itemBatch.AddPutItem(x));

            await itemBatch.ExecuteAsync();

            return(listModels);
        }