Click here to Skip to main content
15,896,606 members
Home / Discussions / C#
   

C#

 
QuestionMin and Max or Range Pin
sunsher21-Mar-18 22:52
sunsher21-Mar-18 22:52 
AnswerRe: Min and Max or Range Pin
OriginalGriff21-Mar-18 23:04
mveOriginalGriff21-Mar-18 23:04 
AnswerRe: Min and Max or Range Pin
Gerry Schmitz22-Mar-18 9:00
mveGerry Schmitz22-Mar-18 9:00 
AnswerRe: Min and Max or Range Pin
Eddy Vluggen22-Mar-18 10:24
professionalEddy Vluggen22-Mar-18 10:24 
AnswerRe: Min and Max or Range Pin
#realJSOP23-Mar-18 2:37
professional#realJSOP23-Mar-18 2:37 
SuggestionRe: Min and Max or Range Pin
Richard Deeming23-Mar-18 9:19
mveRichard Deeming23-Mar-18 9:19 
GeneralRe: Min and Max or Range Pin
sunsher24-Mar-18 0:38
sunsher24-Mar-18 0:38 
GeneralRe: Min and Max or Range Pin
#realJSOP24-Mar-18 1:00
professional#realJSOP24-Mar-18 1:00 
GeneralRe: Min and Max or Range Pin
Eddy Vluggen24-Mar-18 1:05
professionalEddy Vluggen24-Mar-18 1:05 
GeneralRe: Min and Max or Range Pin
#realJSOP24-Mar-18 1:00
professional#realJSOP24-Mar-18 1:00 
GeneralRe: Min and Max or Range Pin
jsc4228-Mar-18 3:02
professionaljsc4228-Mar-18 3:02 
JokeRe: Min and Max or Range Pin
Mycroft Holmes24-Mar-18 13:14
professionalMycroft Holmes24-Mar-18 13:14 
GeneralRe: Min and Max or Range Pin
#realJSOP26-Mar-18 2:10
professional#realJSOP26-Mar-18 2:10 
AnswerRe: Min and Max or Range Pin
MadMyche26-Mar-18 6:26
professionalMadMyche26-Mar-18 6:26 
Questionasync using linq Pin
Member 1347859921-Mar-18 20:42
Member 1347859921-Mar-18 20:42 
AnswerRe: async using linq Pin
Pete O'Hanlon21-Mar-18 22:01
mvePete O'Hanlon21-Mar-18 22:01 
GeneralRe: async using linq Pin
Member 1347859921-Mar-18 22:07
Member 1347859921-Mar-18 22:07 
GeneralRe: async using linq Pin
Pete O'Hanlon21-Mar-18 23:14
mvePete O'Hanlon21-Mar-18 23:14 
GeneralRe: async using linq Pin
Member 1347859922-Mar-18 1:04
Member 1347859922-Mar-18 1:04 
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 

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.