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
Guest User
Tech Writer
611
129.3k
Get List consume time
Nov 12 2020 12:17 AM
I have get data from two table using join in linq c# and show a data list in front end .But its very consume time
I want to not time consume
it's me code
var Result = (from UM
in
_context.UserP
join C
in
_context.ContactUs on UM.UserId equals C.UserId
where UM.UserId == C.UserId
select
new
{
UM.UserImage,
C.Name,
C.UpdatedDate,
C.Email,
C.Message,
C.ContactUsId
}).ToList();
if
(Result.Count > 0)
{
foreach
(var item
in
Result.OrderByDescending(t => t.Name).ToList())
{
ReportManagementViewModel obj =
new
ReportManagementViewModel();
obj.UserName = item.Name;
obj.Email = item.Email;
DateTime aDate = Convert.ToDateTime(item.UpdatedDate);
obj.Date = aDate.ToString(
"MMMM dd, yyyy"
);
obj.Message = item.Message;
obj.UserImage = item.UserImage;
obj.ContactUsId = item.ContactUsId;
List.Add(obj);
Reply
Answers (
1
)
Zapier integration with .net core
How to add Serial/Index # column at the start of Jquery Datatable