Reputation: 15866
I m new about this topic (code first development). I want to do relationship between asp.net default User table and my class (one-to-one).
Could you give me a starting point? My class is like below.
public class Customer
{
[Key]
public int customer_id { get; set; }
public string customer_name{ get; set; }
public string user_id
public virtual User User{ get; set; }
}
I hope, I have explained :)
Thanks.
Upvotes: 1
Views: 948
Reputation: 764
If I undestand correctly - yes, you shoul write all the classes what you want to use in youre code, even if thay exist in the database. Here some tutorial, maybe it can help's you http://codefirst.codeplex.com/
Upvotes: 1