ActiveLogin.Identity
ActiveLogin.Identity copied to clipboard
Unified api for PersonalIdentityNumber, CompanyRegistrationNumber, etc.
When we have implemented more types of IdentityNumbers there will probably be a usecase for parsing an unknown number and get back the type that it is.
The returned type might be something like:
type IdentityNumber =
| SwedishPersonalIdentityNumber of SwedishPersonalIdentityNumber
| CompanyRegistrationNumber of CompanyRegistrationNumber
| PersonalIdentityNumberOrCompanyRegistrationNumber of SwedishPersonalIdentityNumber * CompanyRegistrationNumber
| SwedishCoordinationNumber of SwedishCoordinationNumber
and in C# we cannot be quite as helpful and would have to let the client check themselves what number types that were returned.
public class ParseResult
{
public SwedishPersonalIdentityNumber SwedishPersonalIdentityNumber { get; }
public CompanyRegistrationNumber CompanyRegistrationNumber { get; }
public SwedishCoordinationNumber SwedishCoordinationNumber { get; }
}