簡體   English   中英

ASP .NET Core MVC Entity Framework - 如何訪問由多對多關系產生的表?

[英]ASP .NET Core MVC Entity Framework - How to get access to a table which is result of many-to-many relationship?

如何通過 DatabaseContext object 訪問 ApplicationUserTrip 表? 此表是 Trip 和 ApplicationUser 之間的多對多關系的結果。

我在 Visual Studio 中的 SQL Server 的一部分

只需在您的數據庫上下文中創建它

public class ApplicationUserTrip
{
public string ApplicationUserId {get; set;}
public int TripId {get; set;}
public virtual ApplicationUser ApplicationUser {get;set;]
public virtual Trip Trip {get; set;}
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM