どのクライアントがどのユーザーに接続されているかを確認する必要があるLinqステートメントがあります
public List<Client_Dto> GetClientByBehandelaar(string loggedInUserId)
{
try
{
int userID = Convert.ToInt32(loggedInUserId);
nestorDBDataContext db = new nestorDBDataContext();
var result =
(from relaties in db.tbl_Relaties
where relaties.ID_Persoon == userID
select new Client_Dto()
{
ID = relaties.NestorNrCliënt
}).ToList();
List<Client_Dto> clienten = result;
return clienten;
}
catch (Exception e)
{
throw new ArgumentException("GetClientByBehandelaar Failed " + e);
}
}
ただし、同じユーザーIDを持つDBに87個ある場合でも、1つしか選択されません。私はこれで死ぬまで自分自身を見つめてきました..誰かが助けることができます