Click here to Skip to main content
15,922,584 members
Home / Discussions / C#
   

C#

 
AnswerRe: async using linq Pin
Gerry Schmitz22-Mar-18 9:09
mveGerry Schmitz22-Mar-18 9:09 
GeneralRe: async using linq Pin
Member 1347859922-Mar-18 20:03
Member 1347859922-Mar-18 20:03 
It works fine without the line "SkoreListe = await GetSkorekortSkore(x.SkorekortID)".

I'm not sure if it can work the way i thought it should work, so I have changed it to this instead which works:

    private async Task<List<SkorekortDetailViewModel>> GetItemsAsync(int SkorekortID)
    {
      
      List<SkorekortDetailViewModel> skorekortdetail = await (from s in _db.SkoreKort
              from k in _db.Klub
              from b in _db.Bane
              where (s.SkorekortID == SkorekortID &&
                     s.BaneKlubID == k.KlubID &&
                     s.BaneID == b.BaneID)
              select new {
                s.SkorekortID,
                k.DGUKlubNr,
                s.SkoreDato,
                s.SpillerHCP,                
                k.KlubNavn,                
                b.BaneNavn,
                b.TeeNavn,
                b.HerreDame,
                b.BaneID,
                k.KlubID
              }).AsQueryable() 
                .Select(x => new SkorekortDetailViewModel {
                  SkorekortID = x.SkorekortID,
                  DGUKlubNr = x.DGUKlubNr,
                  SkoreDato = x.SkoreDato,
                  SpillerHCP = x.SpillerHCP,
                  KlubNavn = x.KlubNavn,
                  BaneNavn = x.BaneNavn,
                  TeeNavn = x.TeeNavn,
                  HerreDame = x.HerreDame,
                  BaneID = x.BaneID,
                  KlubID = x.KlubID                  
                }).ToListAsync();

      foreach(var skorekort in skorekortdetail) {

        skorekort.SkoreListe = await GetSkorekortSkoreAsync(skorekort.SkorekortID);
        skorekort.HulListe = await GetHullerAsync(skorekort.BaneID);
        skorekort.BaneListe = await GetBaneAsync(skorekort.KlubID);

      }

      return skorekortdetail;
      
    }

QuestionC# listbox Pin
Member 1373977821-Mar-18 14:42
Member 1373977821-Mar-18 14:42 
QuestionRe: C# listbox Pin
Member 1373977821-Mar-18 15:00
Member 1373977821-Mar-18 15:00 
AnswerRe: C# listbox Pin
BillWoodruff21-Mar-18 17:45
professionalBillWoodruff21-Mar-18 17:45 
GeneralRe: C# listbox Pin
Member 1373977821-Mar-18 18:01
Member 1373977821-Mar-18 18:01 
GeneralRe: C# listbox Pin
BillWoodruff21-Mar-18 18:36
professionalBillWoodruff21-Mar-18 18:36 
GeneralRe: C# listbox Pin
Richard MacCutchan21-Mar-18 22:30
mveRichard MacCutchan21-Mar-18 22:30 
AnswerRe: C# listbox Pin
Gerry Schmitz22-Mar-18 8:48
mveGerry Schmitz22-Mar-18 8:48 
QuestionBuilding Biometeric Application Pin
Member 1351208221-Mar-18 5:37
Member 1351208221-Mar-18 5:37 
AnswerRe: Building Biometeric Application Pin
OriginalGriff21-Mar-18 6:47
mveOriginalGriff21-Mar-18 6:47 
AnswerRe: Building Biometeric Application Pin
Gerry Schmitz22-Mar-18 6:15
mveGerry Schmitz22-Mar-18 6:15 
Questiongeneralizing a function to operate on any type with operator * defined Pin
Alexander Kindel20-Mar-18 13:16
Alexander Kindel20-Mar-18 13:16 
AnswerRe: generalizing a function to operate on any type with operator * defined Pin
Alexander Kindel20-Mar-18 14:52
Alexander Kindel20-Mar-18 14:52 
AnswerRe: generalizing a function to operate on any type with operator * defined Pin
BillWoodruff21-Mar-18 18:34
professionalBillWoodruff21-Mar-18 18:34 
QuestionMessage Removed Pin
20-Mar-18 3:37
Member 1373673020-Mar-18 3:37 
Questioni want to create a chat application without the need of a server Pin
Ma Lek20-Mar-18 0:09
Ma Lek20-Mar-18 0:09 
AnswerRe: i want to create a chat application without the need of a server Pin
OriginalGriff20-Mar-18 0:26
mveOriginalGriff20-Mar-18 0:26 
GeneralRe: i want to create a chat application without the need of a server Pin
Ma Lek20-Mar-18 1:32
Ma Lek20-Mar-18 1:32 
SuggestionRe: i want to create a chat application without the need of a server Pin
Ralf Meier20-Mar-18 1:43
mveRalf Meier20-Mar-18 1:43 
GeneralRe: i want to create a chat application without the need of a server Pin
OriginalGriff20-Mar-18 1:44
mveOriginalGriff20-Mar-18 1:44 
AnswerRe: i want to create a chat application without the need of a server Pin
Ralf Meier20-Mar-18 1:40
mveRalf Meier20-Mar-18 1:40 
AnswerRe: i want to create a chat application without the need of a server Pin
Kevin Marois20-Mar-18 7:14
professionalKevin Marois20-Mar-18 7:14 
AnswerRe: i want to create a chat application without the need of a server Pin
MadMyche20-Mar-18 8:47
professionalMadMyche20-Mar-18 8:47 
QuestionSending byte to comport Pin
Iftikhar_Ahmed19-Mar-18 7:13
Iftikhar_Ahmed19-Mar-18 7:13 

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.