Unable to track an entity of type 'ApplicationRole' because primary key property 'Id' is null

// assign GUID to Id
user.Id = Guid.NewGuid().ToString();
var result = await _userManager.CreateAsync(user, password);

Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
unable to track an entity of type because its primary key property 'id' is null Unable to track an entity of type because its primary key property 'id' is null. System.InvalidOperationException: Unable to track an entity of type 'Customer' because its primary key property 'Id' is null. ef core Unable to track an entity of type 'Documento_Ricevuto__c' because primary key property 'Id' is null Unable to track an entity of type because primary key property Unable to track an entity of type 'xxx' because alternate key property 'id' is null Unable to track an entity of type '' because its primary key property '' is null "Unable to track an entity of type 'Topic' because its primary key property 'Id' is null."} Unable to track an entity of type 'Role' because its primary key property 'Id' is null. Unable to track an entity of type 'PreliminaryBuilding' because primary key property 'ID' is null. Unable to track an entity of type 'AuthUser' because its primary key property 'Id' is null Unable to track an entity of type 'AuthenticationLog' because primary key property 'SessionId' is null. InvalidOperationException: Unable to track an entity of type 'User' because its primary key property 'Id' is null. ype 'Tag' because its primary key property 'Id' is null. Unable to track an entity of type 'Address' because its primary key property 'Id' is null. InvalidOperationException: Unable to track an entity of type 'Branch' because primary key property 'branchId' is null. InvalidOperationException: Unable to track an entity of type 'FarmInfo' because primary key property 'FarmID' is null. Unable to track an instance of type 'UserRole' because it does not have a primary key. Only entity types with primary keys may be tracked.
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source