存储客户端库2.0 - 为什么API并不像直观1.7使用? [英] Storage Client Library 2.0 - Why is the API not as intuitive to use as 1.7?

查看:153
本文介绍了存储客户端库2.0 - 为什么API并不像直观1.7使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我迁移到使用新的存储客户端库对我的Azure表存储。

I am migrating to using the new Storage Client Library for my Azure Table Storage.

与previous查询的存储客户端库1.7 的命名空间:

Querying with the previous Storage Client Library 1.7 namespace:

var orders = serviceContext
                 .CreateQuery<Order>(tableName)
                 .AsTableServiceQuery<Order>()
                 .Where(e => e.PartitionKey == partitionKey && e.RowKey == rowKey)

新的存储客户端库2.0 的类查询:

Querying with the new Storage Client Library 2.0 classes:

string partitionKeyFilter = TableQuery.GenerateFilterCondition("PartitionKey", QueryComparisons.Equal, partitionKey);
string rowKeyFilter = TableQuery.GenerateFilterCondition("RowKey", QueryComparisons.Equal, rowKey);
string combinedFilter = TableQuery.CombineFilters(partitionKeyFilter, TableOperators.And, rowKeyFilter);

var query = new TableQuery<Order>().Where(combinedFilter);
var orders = table.ExecuteQuery<Order>(query);

请纠正我,如果我错了,但1.7是清洁剂,使用强类型的实体,实现了IQueryable的接口,并利用LINQ的全部力量。 2.0版让我觉得我工作了使用ADO.NET数据集。

Please correct me if I'm wrong, but 1.7 is cleaner, uses strongly-typed entities, implements the IQueryable interface and utilizes the full power of LINQ. Version 2.0 makes me feel like I'm working with ADO.NET Datasets again.

我是不是完全缺失的情节吗?据我所知,已经出现了重大的性能提升,但为什么2.0版本觉得这样的降级为API?

Am I completely missing the plot here? I understand that there have been major performance improvements, but why does version 2.0 feel like such a downgrade as an API?

推荐答案

存储客户端库2.0仍然包含在不同的命名空间中的遗留DataService的实施。另一方面,新的表执行已取得显著性能改进更新DataService的执行和SDK的previous版本。根据操作延迟由25%至75%的功能提高而系统资源的利用率也显著下降。

Storage Client Library 2.0 still contains the legacy DataServices implementation in a different namespace. On the other hand, the new table implementation has shown significant performance improvements over the updated DataServices implementation and the previous versions of the SDK. Depending on the operation latencies have improved by between 25% and 75% while system resource utilization has also decreased significantly.

请参阅<一个href="http://blogs.msdn.com/b/windowsazurestorage/archive/2012/11/06/windows-azure-storage-client-library-2-0-tables-deep-dive.aspx"相对=nofollow>的Windows Azure存储客户端库2.0表深潜博客文章以了解更多信息。由于在博客文章中也提到,你仍然可以使用旧的DataService的实现,已迁移到Microsoft.WindowsAzure.Storage.Table.DataServices命名空间,如果你preFER LINQ。

Please refer to Windows Azure Storage Client Library 2.0 Tables Deep Dive blog post for more information. As also mentioned in the blog post, you can still use the legacy DataServices implementation that has been migrated to Microsoft.WindowsAzure.Storage.Table.DataServices namespace if you prefer LINQ.

在新表服务层IQueryable的支持是目前正在开发中。我们没有任何更具体的时间表的细节,分享在这个时候。

IQueryable support in the new Table Service Layer is currently in development. We don't have any more specific timeline details to share at this time.

这篇关于存储客户端库2.0 - 为什么API并不像直观1.7使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆