Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invoking Upsert with alternate keys throws exception if pipeline simulation is turned on #166

Open
Zerajima opened this issue Oct 23, 2024 · 0 comments

Comments

@Zerajima
Copy link

The exception thrown is: "The id parameter '00000000-0000-0000-0000-000000000000' for entity logical name 'dcpwr_datamigration' is not valid."

It is thrown by XrmFakedContext.GetEntityById_Internal, which is called from MiddlewareBuilderPipelineExtensions.GetPreImageEntityForRequest. Here is a full callstack:

System.InvalidOperationException: The id parameter '00000000-0000-0000-0000-000000000000' for entity logical name 'dcpwr_datamigration' is not valid.
   at FakeXrmEasy.XrmFakedContext.GetEntityById_Internal(String sLogicalName, Guid id, Type t)
   at FakeXrmEasy.XrmFakedContext.GetEntityById(String logicalName, Guid id)
   at FakeXrmEasy.Middleware.Pipeline.MiddlewareBuilderPipelineExtensions.GetPreImageEntityForRequest(IXrmFakedContext context, OrganizationRequest request)
   at FakeXrmEasy.Middleware.Pipeline.MiddlewareBuilderPipelineExtensions.<>c__DisplayClass4_0.<UsePipelineSimulation>b__1(IXrmFakedContext context, OrganizationRequest request)
   at FakeXrmEasy.Middleware.MiddlewareBuilder.<>c__DisplayClass9_0.<Build>b__2(OrganizationRequest request)
   at FakeItEasy.ReturnValueConfigurationExtensions.<>c__DisplayClass8_0`2.<ReturnsLazily>b__0(IFakeObjectCall call)
   at FakeItEasy.Configuration.RuleBuilder.ReturnValueConfiguration`1.<>c__DisplayClass28_0.<ReturnsLazily>b__0(IInterceptedFakeObjectCall call)
   at FakeItEasy.Configuration.BuildableCallRule.Apply(IInterceptedFakeObjectCall fakeObjectCall)
   at FakeItEasy.Core.FakeManager.ApplyBestRule(IInterceptedFakeObjectCall fakeObjectCall)
   at FakeItEasy.Core.FakeManager.FakeItEasy.Core.IFakeCallProcessor.Process(InterceptedFakeObjectCall fakeObjectCall)
   at FakeItEasy.Creation.CastleDynamicProxy.CastleDynamicProxyGenerator.ProxyInterceptor.Intercept(IInvocation invocation)
   at Castle.DynamicProxy.AbstractInvocation.Proceed()
   at Castle.Proxies.ObjectProxy.Execute(OrganizationRequest request)
   at FakeXrmEasy.Middleware.Crud.MiddlewareBuilderCrudExtensions.<>c__DisplayClass7_0.<AddFakeUpdate>b__1(Entity e)
   at FakeItEasy.CallbackConfigurationExtensions.<>c__DisplayClass2_0`2.<Invokes>b__0(IFakeObjectCall call)
   at FakeItEasy.Configuration.BuildableCallRule.Apply(IInterceptedFakeObjectCall fakeObjectCall)
   at FakeItEasy.Core.FakeManager.ApplyBestRule(IInterceptedFakeObjectCall fakeObjectCall)
   at FakeItEasy.Core.FakeManager.FakeItEasy.Core.IFakeCallProcessor.Process(InterceptedFakeObjectCall fakeObjectCall)
   at FakeItEasy.Creation.CastleDynamicProxy.CastleDynamicProxyGenerator.ProxyInterceptor.Intercept(IInvocation invocation)
   at Castle.DynamicProxy.AbstractInvocation.Proceed()
   at Castle.Proxies.ObjectProxy.Update(Entity entity)
   at FakeXrmEasy.Middleware.Crud.FakeMessageExecutors.UpsertRequestExecutor.Execute(OrganizationRequest request, IXrmFakedContext ctx)
   at FakeXrmEasy.Middleware.Crud.MiddlewareBuilderCrudExtensions.ProcessRequest(IXrmFakedContext context, OrganizationRequest request)
   at FakeXrmEasy.Middleware.Crud.MiddlewareBuilderCrudExtensions.<>c__DisplayClass3_0.<UseCrud>b__1(IXrmFakedContext context, OrganizationRequest request)
   at FakeXrmEasy.Middleware.Pipeline.MiddlewareBuilderPipelineExtensions.<>c__DisplayClass4_0.<UsePipelineSimulation>b__1(IXrmFakedContext context, OrganizationRequest request)
   at FakeXrmEasy.Middleware.MiddlewareBuilder.<>c__DisplayClass9_0.<Build>b__2(OrganizationRequest request)
   at FakeItEasy.ReturnValueConfigurationExtensions.<>c__DisplayClass8_0`2.<ReturnsLazily>b__0(IFakeObjectCall call)
   at FakeItEasy.Configuration.RuleBuilder.ReturnValueConfiguration`1.<>c__DisplayClass28_0.<ReturnsLazily>b__0(IInterceptedFakeObjectCall call)
   at FakeItEasy.Configuration.BuildableCallRule.Apply(IInterceptedFakeObjectCall fakeObjectCall)
   at FakeItEasy.Core.FakeManager.ApplyBestRule(IInterceptedFakeObjectCall fakeObjectCall)
   at FakeItEasy.Core.FakeManager.FakeItEasy.Core.IFakeCallProcessor.Process(InterceptedFakeObjectCall fakeObjectCall)
   at FakeItEasy.Creation.CastleDynamicProxy.CastleDynamicProxyGenerator.ProxyInterceptor.Intercept(IInvocation invocation)
   at Castle.DynamicProxy.AbstractInvocation.Proceed()
   at Castle.Proxies.ObjectProxy.Execute(OrganizationRequest request)
   at FakeXrmEasy.FakeMessageExecutors.ExecuteMultipleRequestExecutor.Execute(OrganizationRequest request, IXrmFakedContext ctx)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant