Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add enumeration class #154

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions src/1-BuildingBlocks/Contracts/Enumeration/ContractEnumeration.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.ComponentModel.DataAnnotations;
using TaskoMask.BuildingBlocks.Contracts.Resources;

namespace TaskoMask.BuildingBlocks.Contracts.Enumeration
{
/// <summary>
/// Enumeration class refactor from enum
/// </summary>
public class BoardMemberAccessLevel
{
public int Value { get; set; }
[Display(Name = nameof(ContractsMetadata.BoardMemberAccessLevel_Reader), ResourceType = typeof(ContractsMetadata))]
public static BoardMemberAccessLevel Reader { get { return new BoardMemberAccessLevel { Value = 0 }; } }
[Display(Name = nameof(ContractsMetadata.BoardMemberAccessLevel_Writer), ResourceType = typeof(ContractsMetadata))]
public static BoardMemberAccessLevel Writer { get { return new BoardMemberAccessLevel { Value = 1 }; } }
}

public class BoardCardType
{
public int Value { get; set; }
[Display(Name = nameof(ContractsMetadata.CardType_Backlog), ResourceType = typeof(ContractsMetadata))]
public static BoardCardType Backlog { get { return new BoardCardType { Value = 0 }; } }
[Display(Name = nameof(ContractsMetadata.CardType_ToDo), ResourceType = typeof(ContractsMetadata))]
public static BoardCardType ToDo { get { return new BoardCardType { Value = 1 }; } }
[Display(Name = nameof(ContractsMetadata.CardType_Doing), ResourceType = typeof(ContractsMetadata))]
public static BoardCardType Doing { get { return new BoardCardType { Value = 2 }; } }
[Display(Name = nameof(ContractsMetadata.CardType_Done), ResourceType = typeof(ContractsMetadata))]
public static BoardCardType Done { get { return new BoardCardType { Value = 3 }; } }
}

public class UserType
{
public int Value { get; set; }
public static UserType Owner { get { return new UserType { Value = 0 }; } }
public static UserType Operator { get { return new UserType { Value = 1 }; } }
}