Entity Framework
6
EF
6
Home
EF Core
Articles
Knowledge Base
Online Examples
Home
EF Core
Articles
Knowledge Base
Online Examples
Entity Framework 6 - Knowledge Base (KB)
Search
1
results
in tag: defaultifempty
If a LINQ to Entities query produces no results, how do you deliver a default value?
In a LINQ to entities expression like this:...var vote = (from vote in db.Vote where vote.Voter.Id == user.Id select v).FirstOrDefault(); ...How do you add a DefaultIfEmpty value so that when there's no vote I'd get a default value?
defaultifempty
entity-framework
linq
linq-to-entities
asked by
pupeno
Page 1 of 1
1
Prime Library
Performance
Entity Framework Extensions
Entity Framework Classic
Bulk Operations
Dapper Plus
Expression Evaluator
C# Eval Expression
SQL Eval Function
More Projects...
Related
EF Extensions Online Benchmark
WIN an EF Extensions license
EF6 BatchSaveChanges for only $79
Need Performance?
Save your entities 20× faster with EF Extensions
SaveChanges vs BulkSaveChanges