When exactly does Entity Framework Fire a SQL Command?

drumMeersuame

New Member
Suppose I have code like:\[code\]public void TestWhenSqlFires(){ var db = new Db(); // EF DbContext var items = db.SimpleObjects; // SimpleObject implements interface IId var byId = WhereId(items, 1); var array = byId.ToArray();}protected IEnumerable<IId> WhereId(IEnumerable<IId> items, int id){ return items.Where(i => i.Id == id);}\[/code\]At what line in TestWhenSqlFires() will SQL actually be run against the database?(This is a question that spun off from comments on this answer)
 
Top