重命名/前缀SimpleMembership表

时间:2016-12-02 18:08:20

标签: asp.net-mvc

有没有办法为SimpleMembership表添加前缀,我想创建' ProjectName_AspNetUsers'而不是AspNetUsers'?

1 个答案:

答案 0 :(得分:0)

你必须配置web.cnofig>会员资格部分如下:

<membership defaultProvider="MySqlMembershipProvider">
  <providers>
    <clear/>
    <add name="myMembershipProvider"
         type="MySql.Web.Security.MySQLMembershipProvider,
           MySql.Web, Version=6.3.4.0, Culture=neutral,
           PublicKeyToken=c5687fc88969c44d"
         autogenerateschema="true"
         tablePrefix="ProjectName_"
         connectionStringName="ApplicationServices"
         enablePasswordRetrieval="false"
         enablePasswordReset="true"
         requiresQuestionAndAnswer="false"
         requiresUniqueEmail="false"
         passwordFormat="Hashed"
         maxInvalidPasswordAttempts="5"
         minRequiredPasswordLength="6"
         minRequiredNonalphanumericCharacters="0"
         passwordAttemptWindow="10"
         passwordStrengthRegularExpression=""
         applicationName="sparkSources"
 />
  </providers>
</membership>