次のような OperationHelper クラスがあります。
public class OperationHelper
{
/// <summary>
/// Gets or sets the Add Operation value
/// </summary>
public static bool AddOperation { get; set; }
/// <summary>
/// Gets or sets the Edit Operation value
/// </summary>
public static bool EditOperation { get; set; }
/// <summary>
/// Gets or sets the Delete Operation value
/// </summary>
public static bool DeleteOperation { get; set; }
/// <summary>
/// Gets or sets the Select Operation value
/// </summary>
public static bool SelectOperation { get; set; }
}
要求ごとに、この値が再割り当てされます。これをローカルで実行すると、正しく動作します。しかし、コードを公開すると、一部の値が割り当てられないか、機能するはずの値が機能しません。
Asp.Net での static 変数の動作を C# で知りたいです。
静的変数は、すべてのユーザーがアクセスできるグローバル変数と同じですか? ユーザーAがtrueに設定した場合、ユーザーBはその値をTrueとして取得するか、変数のインスタンスが異なります。