すべてのメソッド(ダーティ)でユーザーを取得する必要がないように、コントローラーctor内でカスタムユーザープロバイダーを使用する方法を見つけたいと思います。
これは私のコンストラクターにあるものですが、nullを返し続けますか?
Resource oResource;
public EntityController()
{
try
{
DataEntities oEntities = new DataEntities();
oResource = oEntities.Resources.Where(c => c.user == User.Identity.Name).First();
}
catch
{
oResource = new Resource();
}
}