I have two code first models, Foo and FooState where Foo has an optional FooState.
public class Foo { [Key] public int FooId { get; set; } public Fo
I thought I'd give this a shot and it worked nicely.
public class FooState { [Required] [Key] [ForeignKey("Foo")] public int FooStateId { get; set; } [Required] public int State { get; set; } public Foo Foo { get; set; } }