Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
public class Country
{
public int Id { get; set; }
public string Name { get; set; }
public List<State> States { get; set; }
}
public class State
{
public int Id { get; set; }
public string Name { get; set; }
public int CountryId { get; set; }
public Country Country { get; set; }
}
public class Person
{
public int Id { get; set; }
[Required]
public string Name { get; set; }
public string Biography { get; set; }
[Range(1, int.MaxValue, ErrorMessage = "You must select a state")]
public int StateId { get; set; }
public State State { get; set; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.