Congratulations - C# Corner Q4, 2022 MVPs Announced
Why Join
Become a member
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
C# Corner Home
Technologies
Monthly Leaders
ASK A QUESTION
Forum guidelines
yesubabu k
1.6k
589
46.5k
comma separated values
Jun 21 2019 1:08 AM
Dear Experts,
how to get Comma separated values from entities ?
for my MVC Application using entityframework
example:
var userDeviceList = (from user in db.tblUserMasters
join userInfo in db.UserDeviceMasters on user.Id equals userInfo.DeviceUserID
join prp in db.PropertyMasters on user.CompanyID equals prp.PropertyId
where user.CompanyID == cParam.CompanyId
select new UserDeviceInfo
{
UserId = user.Id,
DeviceUserName = user.UserName,
DeviceId = userInfo.DeviceID,
DeviceStatus = userInfo.DeviceStatus,
IsShared = userInfo.IsShared,
MicroServiceiD = userInfo.MicroServiceiD ?? 0,
RegisteredDate = userInfo.DeviceRegisterdOn,
UserMenuRoleId = userInfo.UserMenuRoleId ?? 0,
MicroServiceName =(from ms in db.Microservices where ms.ID == userInfo.MicroServiceiD select ms.AppsDesc).FirstOrDefault(),
need to get comma separate value here
DevicePropertyName = (from prp in db.PropertyMasters where prp.PropertyId == userInfo.DevicePropertyId select prp.PropertyDesc).FirstOrDefault()
}).OrderBy(o => o.IMEINo).ToList();
Reply
Answers (
2
)
Join two tables
Need help doing a Group count with a join