Example #1
0
        private dynamic GetAuthorsListItems()
        {
            var tmp = Authors.All().ToList();

            // Create authors list for <select> dropdown Workaround for https://github.com/aspnet/EntityFramework/issues/2246
            return(tmp
                   .OrderBy(author => author.LastName)
                   .Select(author => new SelectListItem
            {
                Text = string.Format("{0}, {1}", author.LastName, author.FirstMidName),
                Value = author.AuthorID.ToString()
            }));
        }