TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Marius Vasile
601
1.9k
143.1k
asp.net core getting null date from linq query
Mar 27 2021 12:33 PM
I am using a linq query to get my data from table and I am applying a left join but I couldn't find a way to handle empty dates. Example below
CraftWorkViews = await (from a in _context.WOMains.Where(s => s.OrgID == orgid)
join b in _context.WOPlanners.Where(s => s.Craft == craftid) on a.WOMainID equals b.WOMainID into Temp1
from c in Temp1
join d in _context.WOPlannerSCHs on c.WOMainID equals d.WOMainID into Temp2
from e in Temp2
select
new
CraftWorkView
{
WONumber = c == null ? 0 : c.WONumber,
Subsequent = c == null ? 0 : c.WONumberS,
Activity = c == null ?
" "
: c.Activity,
StartDate = e == null ? ???? : e.StartDateP,
EndDate = e == null ? ???? : e.DueDateP,
CompletionDate = e == null ? ???? : e.CompDateP
}).ToListAsync();
Reply
Answers (
8
)
How Application logout When Server Restart
Hide URL's in MVC ASP.NET CORE