Base solution for your next web application
Open Closed

override id data type in user class of module zero #293


User avatar
0
maddey234 created

Hello team.

I just downloaded the asp net plus module zero start up application for my own project. I have added my additional properties into the user class which inherited from abpuser but my primary key is a string not a long. Please how do I override the primary key?


5 Answer(s)
  • User Avatar
    0
    hikalkan created
    Support Team

    Unfortunately, ABP forces that UserId always must be long. You can not change it. This is by design.

  • User Avatar
    0
    maddey234 created

    So is there a way to work around it

  • User Avatar
    0
    hikalkan created
    Support Team

    No. Have you an existing application? If you are creating a new one, it should not be a problem actually.

  • User Avatar
    0
    maddey234 created

    I am trying to create a new application that relate to staffs and the staff id is unique. This is what I wanted to use as the primary key initially. Is there another way I can go about it.thanks.

  • User Avatar
    0
    hikalkan created
    Support Team

    If you have a staffId that is string, then you can add it to User as a normal property, not primary key. You can define a unique index to prevent duplicate entries.