Ejemplo n.º 1
0
 public MarkupPolicyScope(SubjectMarkupScopeTypes type, int?agencyId = null, int?agentId = null, string locationId = "")
 {
     Type       = type;
     AgencyId   = agencyId;
     AgentId    = agentId;
     LocationId = locationId;
 }
Ejemplo n.º 2
0
 public void Deconstruct(out SubjectMarkupScopeTypes type, out int?agencyId, out int?agentId, out string agentScopeId)
 {
     type         = Type;
     agentScopeId = Type switch
     {
         SubjectMarkupScopeTypes.Global => "",
         SubjectMarkupScopeTypes.Country => LocationId,
         SubjectMarkupScopeTypes.Locality => LocationId,
         SubjectMarkupScopeTypes.Agency => AgencyId.ToString(),
         SubjectMarkupScopeTypes.Agent => AgentInAgencyId.Create(AgentId.Value, AgencyId.Value).ToString(),
         _ => throw new ArgumentOutOfRangeException(nameof(type), Type, "Wrong AgentMarkupScopeType")
     };
     agencyId = AgencyId;
     agentId  = AgentId;
 }