MultiSelect List box is similar to Listbox(single select) control in Razor view, with the help of multi select property you can make your single select ListBox to a MultiSelect ListBox.
Declare one Property as
I am not writing any Model code, I am using service to get the records from table. Just make sure your method should return List/IList/IEnumerable it should be enumerable. something like this
My contract should looks like this(Interface)
and in my service method I will implement the MyMethodName, something like this
above method will return the list of records available in my table, we can put where clause if required, now move to the controller
It’s simple, now go to your razor view and
View Code(Razor View)