Click here to Skip to main content
15,899,634 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Entity Framework : Using summary functions inside a projection Pin
dilkonika16-Feb-15 8:52
dilkonika16-Feb-15 8:52 
GeneralRe: Entity Framework : Using summary functions inside a projection Pin
Richard Deeming16-Feb-15 9:01
mveRichard Deeming16-Feb-15 9:01 
GeneralRe: Entity Framework : Using summary functions inside a projection Pin
dilkonika16-Feb-15 9:11
dilkonika16-Feb-15 9:11 
GeneralRe: Entity Framework : Using summary functions inside a projection Pin
Richard Deeming16-Feb-15 9:20
mveRichard Deeming16-Feb-15 9:20 
GeneralRe: Entity Framework : Using summary functions inside a projection Pin
dilkonika16-Feb-15 9:29
dilkonika16-Feb-15 9:29 
GeneralRe: Entity Framework : Using summary functions inside a projection Pin
Richard Deeming16-Feb-15 9:36
mveRichard Deeming16-Feb-15 9:36 
GeneralRe: Entity Framework : Using summary functions inside a projection Pin
dilkonika16-Feb-15 15:24
dilkonika16-Feb-15 15:24 
GeneralRe: Entity Framework : Using summary functions inside a projection Pin
Richard Deeming17-Feb-15 3:17
mveRichard Deeming17-Feb-15 3:17 
OK, try moving the .GetValueOrDefault() call to a second Select, with an .AsEnumerable() call to make sure it runs in code rather than SQL:
VB.NET
Dim query = From t In context.MyObj1 where t1.id > 6 Select New With { _
    .Parent = t, _
    .sash = t.child1.AsQueryable.Where(Function(t2) t2.tp = 2).Sum(Function(t3) CType(t3.quantity, System.Nullable(Of Decimal))), _
    .vlh = t.child1.AsQueryable.Where(Function(t3) t3.tp = 2).Sum(Function(t3) CType(t3.value, System.Nullable(Of Decimal))) _
}

Dim lst = query.AsEnumerable().Select(Function(t) New With { _
    .Parent = t.Parent, _
    .sash = t.sash.GetValueOrDefault(), _
    .vlh = t.vlh.GetValueOrDefault() _
}).ToList()




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


QuestionHow do I upload a image for a user profile ? Pin
Member 1144766215-Feb-15 5:35
Member 1144766215-Feb-15 5:35 
QuestionRe: How do I upload a image for a user profile ? Pin
Richard MacCutchan15-Feb-15 6:12
mveRichard MacCutchan15-Feb-15 6:12 
AnswerRe: How do I upload a image for a user profile ? Pin
Member 1144766215-Feb-15 6:35
Member 1144766215-Feb-15 6:35 
GeneralRe: How do I upload a image for a user profile ? Pin
Richard MacCutchan15-Feb-15 6:51
mveRichard MacCutchan15-Feb-15 6:51 
QuestionEntity Framework : Which method has better performance ? Pin
dilkonika13-Feb-15 10:57
dilkonika13-Feb-15 10:57 
AnswerRe: Entity Framework : Which method has better performance ? Pin
Eddy Vluggen13-Feb-15 11:58
professionalEddy Vluggen13-Feb-15 11:58 
GeneralRe: Entity Framework : Which method has better performance ? Pin
dilkonika13-Feb-15 13:13
dilkonika13-Feb-15 13:13 
GeneralRe: Entity Framework : Which method has better performance ? Pin
Dave Kreskowiak13-Feb-15 15:57
mveDave Kreskowiak13-Feb-15 15:57 
GeneralRe: Entity Framework : Which method has better performance ? Pin
dilkonika13-Feb-15 18:15
dilkonika13-Feb-15 18:15 
GeneralRe: Entity Framework : Which method has better performance ? Pin
Dave Kreskowiak14-Feb-15 2:27
mveDave Kreskowiak14-Feb-15 2:27 
GeneralRe: Entity Framework : Which method has better performance ? Pin
dilkonika14-Feb-15 4:56
dilkonika14-Feb-15 4:56 
GeneralRe: Entity Framework : Which method has better performance ? Pin
Dave Kreskowiak14-Feb-15 8:12
mveDave Kreskowiak14-Feb-15 8:12 
GeneralRe: Entity Framework : Which method has better performance ? Pin
dilkonika14-Feb-15 9:46
dilkonika14-Feb-15 9:46 
GeneralRe: Entity Framework : Which method has better performance ? Pin
Dave Kreskowiak14-Feb-15 9:48
mveDave Kreskowiak14-Feb-15 9:48 
GeneralRe: Entity Framework : Which method has better performance ? Pin
dilkonika15-Feb-15 15:09
dilkonika15-Feb-15 15:09 
GeneralRe: Entity Framework : Which method has better performance ? Pin
Dave Kreskowiak15-Feb-15 16:21
mveDave Kreskowiak15-Feb-15 16:21 
Questionsteganography Pin
Member 1142179312-Feb-15 9:57
Member 1142179312-Feb-15 9:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.