예제 #1
0
        public virtual async Task <Response <ReadOnlyDictionary <string, object> > > InsertAsync(IDictionary <string, object> entity, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(entity, nameof(entity));

            var response = await _tableOperations.InsertEntityAsync(_table,
                                                                    tableEntityProperties : entity.ToOdataAnnotatedDictionary(),
                                                                    queryOptions : new QueryOptions()
            {
                Format = _format
            },
                                                                    cancellationToken : cancellationToken).ConfigureAwait(false);

            var dict = new Dictionary <string, object>((IDictionary <string, object>)response.Value);

            dict.CastAndRemoveAnnotations();

            return(Response.FromValue(new ReadOnlyDictionary <string, object>(dict), response.GetRawResponse()));
        }