Timeline for How can I implement the generic repository pattern and improve the performance for the code below?
Current License: CC BY-SA 3.0
10 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 5, 2015 at 11:54 | history | edited | Heslacher |
edited tags
|
|
Feb 21, 2014 at 15:07 | vote | accept | Ren | ||
Feb 22, 2013 at 2:39 | answer | added | Robert Wagner | timeline score: 1 | |
Feb 22, 2013 at 2:32 | comment | added | Robert Wagner | yes, EF can translate string concatenation to SQL | |
Feb 20, 2013 at 16:29 | comment | added | Ren | I need the empList because I want to concatenate the firstname and lastname in empResults. do you think it'll still work if i make empList AsEnumerable() ? | |
Feb 18, 2013 at 22:22 | comment | added | Trevor Pilley |
@JeffMercado yes, the one on var empList... is unnecessary overhead the other two calls however are still needed.
|
|
Feb 18, 2013 at 15:01 | comment | added | Jeff Mercado |
@TrevorPilley: Not between empList and empResults , the ToList() call there is superfluous.
|
|
Feb 18, 2013 at 10:42 | comment | added | Trevor Pilley |
@JeffMercado In the current implementation, if the .ToList() calls are removed then there will be an error as the context is disposed before the view is rendered.
|
|
Feb 18, 2013 at 9:25 | comment | added | Jeff Mercado |
If you want to improve performance, you can start by removing the intermediate ToList() calls, you probably don't even need em. If EF complains about the operations you're doing and you're not doing any more filtering beyond that, use AsEnumerable() instead to make it a LINQ to Objects query.
|
|
Feb 18, 2013 at 9:08 | history | asked | Ren | CC BY-SA 3.0 |