when we work with EF code first with existing db then we have to write c# class which represent db table. so tell me when we write class then do i need to mention fields as PK or FK when table already exist ?
public class FooState
{
[Required]
[Key]
[ForeignKey("Foo")]
public int FooStateId { get; set; }
[Required]
public int State { get; set; }
public Foo Foo { get; set; }
}