Saturday, 12 June 2021

Entity framework - distinct & Order By together

  public List<string> ListServers()

        {

            MyDbContext myDbContext = new();


            var results = myDbContext.Apps

              .Select(c => new { c.IISServer})

              .Distinct()

              .OrderBy(x => x.IISServer)

              .Select(x => x.IISServer);


            return results.ToList();

        }

No comments:

Post a Comment

Search This Blog

Creating your first "Alexa" Skill

Index What is Alexa What is Alexa Skill? Why is it required when Alexa already equipped with voice assistant? Dev...