I have a viewmodel which exposes a few public virtual ICollection Roles { get; set; }
This is great for bringing back what roles a user belongs to.. But how do I update the roles of a user from a form.
For testing I've tried adding a hidden field called "Roles" and entered both "Admin" and it's GUID as it's value to send back to the server:
<input type="hidden" name="Roles" value="Admin" />
<input type="hidden" name="Roles" value="7feab829-b86c-4a94-90bf-f35e9ce04b01" />
Howwver, when passes to the server I can see that this way creates an invalid modelstate -- Any suggestions would be greatly appreciated!