Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11508

Linq to SharePoint - lookup column causes performance problem

$
0
0

Hi All,

I have a simple line of code:

 this.Shipping2WarehouseTitle = _ts.GetWarehouse();

in the following context:

public partial class Shipping
{
...
internal void SetupTiming(TimeSlotTimeSlot _ts, bool _isDouble)
{
 this.Shipping2WarehouseTitle = _ts.GetWarehouse();
}
....
}

public partial class TimeSlotTimeSlot{
{
....
  internal Warehouse GetWarehouse(){
  ....      
    return this.TimeSlot2ShippingPointLookup.WarehouseTitle;
  }
}

As I am using Linq to SharePoint Warehouse, Shipping and TimeSlotTimeSlot are Entities generated by SPMETAL coupled with the above partial custom code.  Shipping2WarehouseTitle is a lookup column (property) ofWarehouse type.

Question: The execution time of the above mentioned line of code is measured in seconds, but I expect nanoseconds !!

TimeSlotTimeSlot is a value of the reference type, and GetWarehouse() returns it immediately, so why it takes seconds ?!

Is there something magic under the cover.

Mariusz


Mariusz


Viewing all articles
Browse latest Browse all 11508

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>