Can I edit Identity’s Aspnetusers table?

Asked

Viewed 891 times

2

Galera I have a project that has a table of USUARIOS. And now we’re migrating to AspNet.Identity which already has a table but called AspNetUser and with your own fields. And my table USUARIOS have relationships with People and other tables of my context.

I even thought about keeping the 2 tables and at the time of registering new user, or update the user, change in the 2. But maintaining 2 tables with duplicate data does not seem correct.

So how to customize Aspnetuser to have the name, fields and relationships that I need? Since I started the project without authentication and added Entity from Nuget. Another fact is that I am using Codefirst in the general context of the application. And in the image below is my existing USER table, which cannot be modified. I believe that Aspnetuserrules could become PROFILES too, right?

inserir a descrição da imagem aqui

  • Still I edited your question, that’s what you wanted to know?

  • Exactly! I’m starting with Identity. This is the first time I’ve tried to deploy it in a solution. So I know this question may sound silly, but any hint helps me.

  • Let’s wait for the opinion of someone more experienced, but I would be in the second option for the little I know.

  • This question does not fit on the site because it only accepts answers based on opinion. But, trying to collaborate with you, I usually choose to leave everything related to the user in the same table (AspNetUsers, for example), I see no point in keeping two tables for the same thing.

  • If that’s the case, it looks like I’m screwed. kkkk! I am not familiar with Codefirst, I saw some response here at Stack Overflow, but only in English and I confess that I did not understand well. For example:https://stackoverflow.com/questions/28335353/how-to-extend-available-properties-of-user-identity Here I ask you: Where would this [public class Applicationuser : Identityuser] be for me to add the properties? Or should I raise her?

  • Do you know any tutorial in Portuguese that can indicate me?

  • @Still You could change the "tone" of your question to something like, "Can I edit the Aspnetusers table from Identity?" thus your question would no longer fit as based on opinions and you would still have your "tutorial in English" =D

  • @LINQ Thanks for the tip. I’ll do it.

Show 3 more comments

1 answer

1


Browser other questions tagged

You are not signed in. Login or sign up in order to post.