How to pass an array of integer separated by comma to an ExecuteStoreCommand
in the entities
as a parameter
I am not able to execute this :
this.Obj
Same approach as the answer, just demonstrating using strongly typed result set.
void Main()
{
int[] operationIds = { 1000, 1001 };
var result = ObjectContext.ExecuteStoreQuery(
$@"SELECT OperationId, Name, OfficialId, IsPatientEncrypted FROM Patient WHERE OperationId IN ({string.Join(",", operationIds)})");
result.Dump();
}
Dump method is a method in Linqpad. Screenshot of working sample in Linqpad 5:
As the accepted answer said: