c# - Is using navigation properties to "Add" related items slow? -


i have device list of other devicelogentry. device.logs navigational property , add new logs so

device.logs.add(newentry);      

logs defined so

public virtual icollection<devicelogentry> logs { get; set; } 

my question load entire logs table before adding new one? if (this slow logs contains lots of entries). better (faster) alternative?

looks issue aren't fixing now: http://entityframework.codeplex.com/workitem/683

couple of things try.

  1. disable lazy loading entity removing virtual
  2. do addition other way around if applicable

for point 2, case of exposing deviceid on log table, , instead of doing:

device.logs.add(newentry);   

would like:

newentry.deviceid = _deviceid; context.logs.add(newentry); 

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -