Created
February 13, 2014 14:36
-
-
Save kidchenko/8976105 to your computer and use it in GitHub Desktop.
Exemplo de relacionamentos com EF
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//1 : 1 | |
public class Produto | |
{ | |
[Key] | |
public int Id {get;set;} | |
[ForeignKey("Categoria")] | |
public int CategoriaId {get;set;} | |
/*Outros atributos*/ | |
public virtual Categoria Categoria {get; set;} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment