質問

私はユーザーがテキストボックス内のデータを入力して送信をクリックし、[送信]をクリックすると、そのURLにこのデータが含まれているすべてのサイトコレクションにTextBoxでは、すべてのサイトを持参するためのLINQクエリを実行します。URLにこのテキストボックスの値が含まれている現在のWebアプリは、これが最良の方法であるかどうかわからない、そして私はこのようにしてすべてのSpsite Disosaleをよく扱うかどうかわからない、私は処分する必要があるかどうかわからないこれらのオブジェクトのもの助け?

役に立ちましたか?

解決

You will need to dispose the SPSite objects and write an extension method for that since it is in LINQ. However, you can also achieve your result using foreach loops instead of LINQ.

See this for more information on using LINQ and SharePoint objects which need to be disposed like SPSite and SPWeb:

https://stackoverflow.com/questions/657095/using-linq-with-sharepoint-and-disposing-of-objects http://solutionizing.net/2009/01/05/linq-for-spwebcollection-revisited-assafeenumerable/

ライセンス: CC-BY-SA帰属
所属していません sharepoint.stackexchange
scroll top