Click here to Skip to main content
15,791,229 members
Home / Discussions / C#
   

C#

 
GeneralRe: Error: Object reference not set to an instance of an object in C# Pin
V.18-Jan-18 4:25
professionalV.18-Jan-18 4:25 
QuestionException raised at wpf designer level Pin
abboudi_ammar16-Jan-18 8:35
abboudi_ammar16-Jan-18 8:35 
QuestionHow to convert a query to lambda based Pin
Mou_kol16-Jan-18 2:43
Mou_kol16-Jan-18 2:43 
AnswerRe: How to convert a query to lambda based Pin
OriginalGriff16-Jan-18 2:52
mvaOriginalGriff16-Jan-18 2:52 
GeneralRe: How to convert a query to lambda based Pin
Mou_kol16-Jan-18 4:50
Mou_kol16-Jan-18 4:50 
GeneralRe: How to convert a query to lambda based Pin
Mou_kol24-Jan-18 1:26
Mou_kol24-Jan-18 1:26 
GeneralRe: How to convert a query to lambda based Pin
OriginalGriff24-Jan-18 1:44
mvaOriginalGriff24-Jan-18 1:44 
AnswerRe: How to convert a query to lambda based Pin
Richard Deeming16-Jan-18 4:03
mveRichard Deeming16-Jan-18 4:03 
Something like this should work:
C#
var usersWithRoles = context.Users
    .Select(user => new
    {
        UserId = user.Id,
        Username = user.UserName,
        Email = user.Email,
        RoleNames = user.Roles.Join(context.Roles, userRole => userRole.RoleId, role => role.Id, (userRole, role) => role.Name)
    })
    .AsEnumerable()
    .Select(p => new Users_in_Role_ViewModel
    {
        UserId = p.UserId,
        Username = p.Username,
        Email = p.Email,
        Role = string.Join(",", p.RoleNames)
    });




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


GeneralRe: How to convert a query to lambda based Pin
Mou_kol16-Jan-18 4:50
Mou_kol16-Jan-18 4:50 
GeneralRe: How to convert a query to lambda based Pin
Mou_kol24-Jan-18 1:35
Mou_kol24-Jan-18 1:35 
Questioncontour plot in visual studio Pin
Member 1362407415-Jan-18 7:27
Member 1362407415-Jan-18 7:27 
AnswerRe: contour plot in visual studio Pin
Richard MacCutchan15-Jan-18 8:15
mveRichard MacCutchan15-Jan-18 8:15 
QuestionI got the error that: Not all code paths return a value Pin
irisemars15-Jan-18 3:15
irisemars15-Jan-18 3:15 
AnswerRe: I got the error that: Not all code paths return a value Pin
Jochen Arndt15-Jan-18 3:22
professionalJochen Arndt15-Jan-18 3:22 
AnswerRe: I got the error that: Not all code paths return a value Pin
OriginalGriff15-Jan-18 5:10
mvaOriginalGriff15-Jan-18 5:10 
QuestionSpeech recognition: Unable to LoadGrammar and no installed recognizer Pin
Mc_Topaz13-Jan-18 4:35
Mc_Topaz13-Jan-18 4:35 
QuestionSelect data from MSSQL database and insert into oracle database Pin
Member 1346617612-Jan-18 3:51
Member 1346617612-Jan-18 3:51 
AnswerRe: Select data from MSSQL database and insert into oracle database Pin
Richard MacCutchan12-Jan-18 4:11
mveRichard MacCutchan12-Jan-18 4:11 
AnswerRe: Select data from MSSQL database and insert into oracle database Pin
Richard Deeming12-Jan-18 4:13
mveRichard Deeming12-Jan-18 4:13 
GeneralRe: Select data from MSSQL database and insert into oracle database Pin
Member 1346617612-Jan-18 4:36
Member 1346617612-Jan-18 4:36 
GeneralRe: Select data from MSSQL database and insert into oracle database Pin
Richard Deeming12-Jan-18 4:45
mveRichard Deeming12-Jan-18 4:45 
GeneralRe: Select data from MSSQL database and insert into oracle database Pin
Member 1346617612-Jan-18 5:01
Member 1346617612-Jan-18 5:01 
QuestionSystem.IO.IOException: 'The I/O operation has been aborted because of either a thread exit or an application request Pin
Member 1058555811-Jan-18 12:19
Member 1058555811-Jan-18 12:19 
AnswerRe: System.IO.IOException: 'The I/O operation has been aborted because of either a thread exit or an application request Pin
OriginalGriff11-Jan-18 12:25
mvaOriginalGriff11-Jan-18 12:25 
AnswerRe: System.IO.IOException: 'The I/O operation has been aborted because of either a thread exit or an application request Pin
Bernhard Hiller11-Jan-18 22:35
Bernhard Hiller11-Jan-18 22:35 

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.