AjaxItemSelect.Controllers.Manager.ArtistGetAll C# (CSharp) Метод

ArtistGetAll() публичный Метод

public ArtistGetAll ( ) : IEnumerable
Результат IEnumerable
        public IEnumerable<ArtistBase> ArtistGetAll()
        {
            return Mapper.Map<IEnumerable<ArtistBase>>(ds.Artists.OrderBy(a => a.Name));
        }

Usage Example

Пример #1
0
        // GET: Tracks
        public ActionResult Index()
        {
            // Fetch the collection
            var c = m.ArtistGetAll();

            // Create a form
            var form = new ArtistForm();

            form.ArtistList = new SelectList(c, dataValueField: "ArtistId", dataTextField: "Name");

            return(View(form));

            // Attention - 05 - Notice several things in the list-of-artists view...
            // The dropdown list has an "onchange" attribute that calls a JavaScript method
            // The view includes two <div> elements that will be filled in later
            // The "Send" (submit) button is disabled

            // Attention - 06 - Study the artistSelected() method in the JavaScript core.js source code file
        }