简体   繁体   English

如何将RefId传递给Servicestack中的UserAuthDetail表?

[英]How do I pass a RefId to the UserAuthDetail table in Servicestack?

I see that servicestack supports passing an int? 我看到servicestack支持传递一个int? RefId and string RefString in both the Userauth table and the UserAuthDetail table. Userauth表和UserAuthDetail表中的RefId和字符串RefString。 I have hooked up my sign-up/sign-in process to facebook, but when it tries to add the user I get an error telling me that RefID can't be null? 我已将我的注册/登录过程连接到Facebook,但当它尝试添加用户时,我收到错误,告诉我RefID不能为空? The UserAuthDetail table was created with "Allow Nulls" set to false on that column and no default value supplied. UserAuthDetail表是在该列上将“Allow Nulls”设置为false而创建的,并且未提供默认值。 The UserAuth table is set to "allows null" on that column. UserAuth表在该列上设置为“允许null”。

How do I pass a refid to the signup process? 如何将refid传递给注册过程? I know that there is some way to pass it on the querystring but I don't now how to get in the middle of the OAuth transaction. 我知道有一些方法可以在查询字符串上传递它,但我现在不知道如何进入OAuth事务的中间。 Is there some method I can override? 我可以覆盖一些方法吗?

Should I just change the table? 我应该换桌子吗?

The RefId is a int? RefId是一个int? column which OrmLite creates allowing null as expected. OrmLite根据预期创建允许为null列。 I'd leave the properties on any POCO's you don't control to reflect the underlying RDBMS schema otherwise you'll run into runtime issues like this. 我将属性保留在您无法控制的任何POCO上以反映底层的RDBMS架构,否则您将遇到像这样的运行时问题。

You can use the OnAuthenticated()/OnRegistered() Session or Auth Events to customize what data is stored in the underlying UserAuth table using a Custom UserSession OnAuthenticated event . 您可以使用OnAuthenticated()/OnRegistered() 会话或Auth事件来自定义使用Custom UserSession OnAuthenticated事件在基础UserAuth表中存储的数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM