public MarkupPolicyScope(SubjectMarkupScopeTypes type, int?agencyId = null, int?agentId = null, string locationId = "") { Type = type; AgencyId = agencyId; AgentId = agentId; LocationId = locationId; }
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; }