C# 在Lightswitch中创建并使用新的ProfileProvider属性
如何使用Lightswitch创建和访问ProfileProvider的新属性 我试过这个: 修改了Web.config/configuration/system.Web中的下一节/C# 在Lightswitch中创建并使用新的ProfileProvider属性,c#,visual-studio-lightswitch,lightswitch-2013,profile-provider,sqlprofileprovider,C#,Visual Studio Lightswitch,Lightswitch 2013,Profile Provider,Sqlprofileprovider,如何使用Lightswitch创建和访问ProfileProvider的新属性 我试过这个: 修改了Web.config/configuration/system.Web中的下一节/ <profile enabled="True" defaultProvider="AspNetProfileProvider"> <providers> <clear /> <add name="AspNetProfileProvider" type="
<profile enabled="True" defaultProvider="AspNetProfileProvider">
<providers>
<clear />
<add name="AspNetProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="_IntrinsicData" applicationName="MyApplication" />
</providers>
<properties>
<add name="FullName" />
<add name="MyCustomProperty" />
</properties>
</profile>
当我转到..User.FullName的定义时,我会看到一个自动生成的类,其中有属性FullName,但没有MyCustomProperty:
var a = ServerApplicationContext.CreateContext().Application.User.FullName; // Work
var b = ServerApplicationContext.CreateContext().Application.User.MyCustomProperty; // Don't work
public class ServerUser : ClaimsPrincipal, IUserInternal, IUser, IPrincipal, IIdentity
{
public AuthenticationType AuthenticationType { get; protected set; }
public IEnumerable<string> EffectivePermissions { get; }
public string FullName { get; protected set; }
public bool IsAnonymous { get; }
...
}
我想重建不是自动生成代码的方式,但我不知道如何实现这一点
谢谢