我有以下Azure SQL表:
id customerid value
01 1 test
02 1 none
03 2 exam
04 2 what
05 3 rule
06 4 game
我有多个客户应该使用此应用程序(例如customer1,customer2等)
目前,我可以将此表中的所有数据同步到我的应用,但我想“过滤”数据,以便customer1只能将他/她的行从Azure SQL同步到应用程序。
谢谢!
答案 0 :(得分:1)
您只需要在查询中添加其他Where()子句,例如:
var items = await todoTable.Where(todoItem =>!todoItem.Done&& todoItem.customerid == 当前用户的id )。ToEnumerableAsync();