开发者

Code First with model coming from seperate database

I'm creating a chat system but the user table is from a seperate database. But on my database, I have Message which has a User parent. How do I handle a situation like this?开发者_如何学C I know when a user is logged in and I have their Id. Should I create a new user table and if the id does not exist I create it when creating a new message? What other option is there?

I'm using Entity Framework Code-first.


Simply use the Message table with just UserId column. Data integrity and loading of related user would be done by your application logic. EF doesn't need to know anything about that.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜