Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [Table("User")]
- class User{
- [Key]
- public int idUser;
- public int idComputer; //ForeignKey
- }
- [Table("Computer")]
- class Computer{
- [Key]
- public int idComputer;
- }
- public class User
- {
- public User()
- {
- }
- public int idUser; { get; set; }
- [Required]
- public string UserName { get; set; }
- public virtual Computer Computer{ get; set; }
- }
- public class Computer
- {
- public Computer()
- {
- }
- [Key, ForeignKey("User")]
- public int idUser{ get; set; }
- public string ComputerName {get;set;}
- public virtual User User { get; set; }
- }
- [Table("User")]
- public class User
- {
- [Key]
- public int idUser;
- public int idComputer;
- public virtual Computer Computer;
- }
- [Table("Computer")]
- public class Computer
- {
- [Key, ForeignKey("User")]
- public int idComputer;
- public virtual User User;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement