InvalidOperationException: The property 'Id' on entity type 'Customer' has a temporary value while attempting to change the entity's state to 'Unchang

Posted: October 11, 2018 at 12:03 PM Quote #213072
Hi,

I am working on nopcommerce project and trying to develop new features to my own shop at my local machine. Nopcommerce suddenly started to display this error  at website's Homepage. My development is not related with Customer table or it's entities. I can't trace exception's source. Please help.

"An unhandled exception occurred while processing the request.
InvalidOperationException: The property 'Id' on entity type 'Customer' has a temporary value while attempting to change the entity's state to 'Unchanged'. Either set a permanent value explicitly or ensure that the database is configured to generate values for this property.
Nop.Web.Framework.Infrastructure.Extensions.ApplicationBuilderExtensions+<>c.<UseNopExceptionHandler>b__1_1(HttpContext context) in ApplicationBuilderExtensions.cs, line 83

InvalidOperationException: The property 'Id' on entity type 'Customer' has a temporary value while attempting to change the entity's state to 'Unchanged'. Either set a permanent value explicitly or ensure that the database is configured to generate values for this property.
Nop.Web.Framework.Infrastructure.Extensions.ApplicationBuilderExtensions+<>c.<UseNopExceptionHandler>b__1_1(HttpContext context) in ApplicationBuilderExtensions.cs
-
                            EngineContext.Current.Resolve<ILogger>().Error(exception.Message, exception, currentCustomer);
                        }
                    }
                    finally
                    {
                        //rethrow the exception to show the error page
                        throw exception;
                    }
                });
            });
        }
        /// <summary>
Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: November 06, 2018 at 2:28 PM Quote #214016
I have the same issue please help...
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: November 07, 2018 at 4:48 AM Quote #214034
Hi boutroux i solved problem myself. Please check using of your method. I was using a method created for administrator section. That was source of my problem.

Cheers
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: November 07, 2018 at 7:19 AM Quote #214037
I resolved by myself too, in my case was a bad and old trigger on the address table of customer.

Thanks anyway...

cheers.
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Premium support services
  • Dedicated premium support services provided by core developers are intended for persons who run mission critical websites, work on projects with tight deadlines, or want to get dedicated support.
Professional services
  • Want to open a new store? Want to take your store to the next level? Need a custom extension? We can customize nopCommerce to fit your store perfectly. Request a quote to get started.