Joakim M
Joakim M

Reputation: 1803

"Filter" Queries from Azure App Service

I have the following Azure SQL table consisting of:

id   customerid   value
01            1    test
02            1    none
03            2    exam
04            2    what
05            3    rule
06            4    game

I have multiple customers that are supposed to use this app (E.g. customer1,customer2 etc.)

At the moment I am able to sync ALL data in this table to my app but I would like to "filter" the data so that customer1 only is able to sync his/her rows from Azure SQL to the app.

Thanks!

Upvotes: 0

Views: 88

Answers (1)

VortexSuit
VortexSuit

Reputation: 56

You just need to add additional Where() clauses to your query, so for example:

var items = await todoTable.Where(todoItem => !todoItem.Done && todoItem.customerid == id of current user here).ToEnumerableAsync();

Upvotes: 1

Related Questions