Lightswitch を使用して ProfileProvider の新しいプロパティを作成してアクセスするにはどうすればよいですか?
私はこれを試しました: Web.config/configuration/system.web/ の次のセクションを変更しました
<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>
次に、ソリューションを再構築し、それを使用しようとすると、FullName は取得できますが、MyCustomProperty は取得できません。
var a = ServerApplicationContext.CreateContext().Application.User.FullName; // Work
var b = ServerApplicationContext.CreateContext().Application.User.MyCustomProperty; // Don't work
..User.FullName の定義に移動すると、Property FullName はあるが MyCustomProperty がない自動生成クラスに到達します。
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; }
...
}
再構築はコードが自動生成される方法ではないと思いますが、これを達成する方法の手がかりがありません。
ありがとう。