-
Hi all, I have a use case where I have to check if the primaryentityid being passed in the context is Guid.Empty or not. I have written the following test case where I mock the primaryentityid as follows:
But when I am trying to compare it in the Plugin code I found that it is being set to Guid.Empty Has someone faced this issue previously? If yes, can you please help me with the solution. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
Hello @vijayrit fake-xrm-easy/FakeXrmEasy.Shared/XrmFakedContext.Plugins.cs Lines 78 to 88 in f294b9a |
Beta Was this translation helpful? Give feedback.
-
Yes, this has caused a bit of confusion. When you execute the plugin with the target as a parameter, it'll use the properties of the target as Betim said above, otherwise, you would need to use the method overload that receives the plugin context method instead. |
Beta Was this translation helpful? Give feedback.
Hello @vijayrit
PrimaryEntityId gets read from the Target entity:
fake-xrm-easy/FakeXrmEasy.Shared/XrmFakedContext.Plugins.cs
Lines 78 to 88 in f294b9a