FAQ Database Discussion Community


How can I force EF to use joins instead of splitting up a complicated query?

c#,entity-framework,entity-framework-6,iqueryable,deferred-execution
I have a complex IQueryable that I would like EF to populate with a single database query so that I can use it with deferred execution. Please consider the following example. For these models: public enum AlphaState { Unknown = '\0', Good = 'G', Bad = 'B' } [Table("MY_ALPHA")] public...

Converting IEnumerable to Dictionary

c#,dictionary,casting,ienumerable,deferred-execution
after adding bool distinct to method Splitter and checking if distinct is true the code broke. The quesry now instead of being dictionary is IEnumerable<string>, but whould be Dictionary<string, int>. How could it be solved? This is the error: Cannot implicitly convert type 'System.Collections.Generic.IEnumerable' to 'System.Collections.Generic.Dictionary'. An explicit conversion exists...