Created
April 20, 2023 16:56
-
-
Save carloswm85/a08b1d13f622e1f995d185a57e81ba52 to your computer and use it in GitHub Desktop.
How do I add Title to this SelectList? Or any other data-* HTML attribute?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public IEnumerable<SelectListItem> GetProducersSelectList() | |
| { | |
| SelectList selectList = new SelectList( | |
| ProducersList | |
| .Select( | |
| producer => | |
| new | |
| { | |
| Text = producer.ProducerNumber + " • " + producer.Surname + ", " + producer.Name, | |
| Value = producer.Id.ToString(), | |
| Title = producer.BusinessName | |
| }), | |
| "Value", | |
| "Text" | |
| ); | |
| return selectList; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment