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

Tests: address generator fix #733

Merged
merged 2 commits into from
Jul 7, 2022

Conversation

i-rakityanskiy
Copy link
Contributor

@i-rakityanskiy i-rakityanskiy commented Jul 6, 2022

IndexFaker has an initial value of 0. When entity with Id=0 is added to the DB context, EF implicitly changes Id value to 1. When the second entity with Id=1 is generated and added to the DB context it causes the exception System.InvalidOperationException : The instance of entity type 'Address' cannot be tracked because another instance with the key value '{Id: 1}' is already being tracked. When attaching existing entities, ensure that only one entity instance with a given key value is attached.

@i-rakityanskiy i-rakityanskiy requested a review from h4wk13 July 6, 2022 11:14
@i-rakityanskiy i-rakityanskiy self-assigned this Jul 6, 2022
@i-rakityanskiy i-rakityanskiy mentioned this pull request Jul 6, 2022
9 tasks
@i-rakityanskiy i-rakityanskiy force-pushed the iraki/tests-address-generator-fix branch from cc1f03d to a7fe4fb Compare July 7, 2022 06:11
@i-rakityanskiy i-rakityanskiy merged commit 14db68e into develop Jul 7, 2022
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jul 7, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@i-rakityanskiy i-rakityanskiy deleted the iraki/tests-address-generator-fix branch July 14, 2022 10:30
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

Successfully merging this pull request may close these issues.

2 participants