如何配置的用户上下文/表? [英] How do I configure the Users context/table?

查看:124
本文介绍了如何配置的用户上下文/表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过发布新的ASP.NET MVC 5 preVIEW,我该如何配置用户上下文/表?

With the new ASP.NET MVC 5 Preview released, how do I configure the Users context/table?

在MVC 4我只想用我自己的用户类,然后点WebSecurity初始化它,这题刻:

In MVC 4 I would just use my own User class and then point the WebSecurity initialize to it, tike this:

WebSecurity.InitializeDatabaseConnection(connectionString, "System.Data.SqlClient", userTableName, userIdColumn, userNameColumn, autoCreateTables);

我要附加属性添加到用户类 - 如何

I wish to add additional properties to the Users class - how?

推荐答案

的UserStore和用户类别有能够基于EF实现更容易,但你总是可以降下来,实现自己的自定义IUserStore,并通过在自己的DbContext。

The UserStore and User classes are there to make EF based implementations easier, but you can always drop down and implement your own custom IUserStore and pass in your own DbContext.

如果你需要我可以提供一个更详细的例子。

I can provide a more detailed example if you need.

这篇关于如何配置的用户上下文/表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆