예제 #1
0
        public async Task <IEnumerable <OperationResult <RelationalEntity> > > InsertAndRetrieve(IList <RelationalEntity> entities)
        {
            var output = new OperationResult <RelationalEntity> [entities.Count];
            int index  = 0;

            var executer = _client.CreateRelationalBatchExecuter(RelationalBatchExecutionMode.Transactional);

            foreach (var entity in entities)
            {
                executer.InsertAndRetrieveEntity(entity, out output[index++]);
            }

            await executer.ExecuteAsync();

            return(output.AsEnumerable());
        }