如何使用一个linq语句获得Direct blob uri? [英] How can I get Direct blob uri using one linq statement?

查看:75
本文介绍了如何使用一个linq语句获得Direct blob uri?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有下面的代码匹配特定的字符串并返回blob uri.but这是耗时的并且需要更多的执行时间。



所以我想单身返回返回blob的声明uri.how我可以这样做。我可以用container.ListBlobs()或任何其他想法指定where语句。请帮助我。





I have below code that match particular string and return blob uri.but this is time consuming and take a more execution time.

So I want to single return statement that return blob uri.how can I do that.how can I specify where statement with container.ListBlobs() or any other idea.Please help me.


foreach (var properties in container.ListBlobs())
          {
                var blob = properties.Container.GetBlobReference(properties.Uri.ToString());
              if (intBLOBID == RemoveFileExtension(blob.Uri.Segments[2]))
                  return blob.Uri.ToString();

          }







请给我合适的解决方案以上修改后的声明



等待快速回复。



谢谢。




Please give me proper solution with above modified statement.

Waiting for quick reply.

Thanks.

推荐答案

你可以避免调用GetBlobReference,因为你已经拥有了blob的uri。无论如何,瓶颈可能是网络延迟而不是计算时间,为此你可以做的不多:)



- 编辑

等一下,你想做什么?如果你已经知道blob名称为什么不直接检查是否存在?
You could avoid calling GetBlobReference since you already have the uri of the blob. Anyway the bottleneck is probably in the network latency rather than in computation time, and for that there's not much you can do :)

--Edit
Wait a second, what are you trying to do? if you alread have the blob name why not simply check for existence?


这篇关于如何使用一个linq语句获得Direct blob uri?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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