Hello.

I'm using VS2010, MVC 3, Razor and Entity Framework 4.

I want to have a drop down list with list of all countries from the Countries table. And in my model, I have just a single country id (Guid).

So, in my Model, I have:
Code:
public Guid? CountryID
{ get; set; }
In my Controller, I have:
Code:
ViewBag.Countries = from e in new MyEntities().Countries select e;
And in my View, I have:
Code:
@Html.DropDownListFor(m => m.CountryID, new SelectList(ViewBag.Countries, "CountryID", "Name"), "")
If I choose something or not, i get the "Value cannot be null", on the View line of the code (@Html.DropDown...). What am I doing wrong?

Also, cause I'm totally new to MVC and Entity Framework, is there a better way to achieve this? I'm Googling this for few hours now with no results...

EDIT: I have just seen I've posted in the wrong forum section, so please, redirect this. Sorry.