0

i have customized my own implementation for ServiceStack's authentication. I created my own 'User' table, which is inherited from UserAuth, so there is 'Id' field from UserAuth, but now I created a 'UserId' field (Guid) and set it to primary key in database, meanwhile i removed the 'Id'. But ServiceStack throws an error when i tried to register a new user. If UserId and Id both exist, the UserId (which as been set as the primary key) doesn't get populated with Guid at all.

{
  "ResponseStatus": {
    "ErrorCode": "SqlException",
    "Message": "Invalid column name 'Id'.",
    "StackTrace": "[Register: 2/11/2015 5:12:41 AM]:\n[
Isley
  • 197
  • 15

1 Answers1

3

You can't change the primary key of the existing UserAuth table and use the built-in UserAuth repositories. You may need to create your own Database AuthRepository otherwise have a look at other ways to extend ServiceStack User Auth, if you want to use a Guid Primary Key then you'd need to create and reference an external table separate from UserAuth.

Community
  • 1
  • 1
mythz
  • 141,670
  • 29
  • 246
  • 390