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

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

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

            dict.CastAndRemoveAnnotations();

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