0
我有一個名爲Store
的類,它恰好有一個名爲User
的屬性。ASP.NET獲取登錄用戶的用戶名
此User
可以稍後登錄到應用程序。
問題: 我試圖創建一個基於當前登錄的
例Store
表的User
的Stores
的列表:最後一列Usuario a.k.a. User
我試過的東西:
var Tiendas = await _context.Stores
.Where(t => t.Usuario= User.Identity.Name.ToString()).ToListAsync();
這是密切的嘗試嗎?我發現了一個錯誤:
Can't convert the type string into bool.