Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class User
- {
- public int Id {get;set;}
- public string Name {get;set;}
- public string Surname{get;set;}
- }
- public class News
- {
- public int Id {get;set;}
- public string Content {get;set;}
- [ForeignKey("OwnerUser")]
- public int OwnerUserId{ get; set; }
- public virtual User OwnerUser{ get; set; }
- }
- public News InsertNews(News instance)
- {
- instance = RealInsertionCode(instance);
- User usr = GetObjectById(OwnerUserId);
- instance.OwnerUser = usr;
- return instance;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement