Class TeamMemberTypeResolver
Works out which ITeamMember type a team service is built around, when the host did not say so explicitly.
public static class TeamMemberTypeResolver
- Inheritance
-
TeamMemberTypeResolver
- Inherited Members
Remarks
The two-argument RegisterTeamService<TServiceBase, TUserService>() overload takes no
member type, and everything that a component injects — ITeamManagementService and its four
sibling facets — is built from TeamManagementService<TMember> and therefore needs one.
Without it those facets were simply not registered, and the failure surfaced when a page was rendered
rather than when the application started.
Inference outranks the default. A host that declared its own member type and used the
two-argument overload must get their type, not the toolkit's — handing them
TeamMember when their entity holds something else is worse than registering nothing, because
it would fail on the data rather than at the seam.
Methods
Resolve(Type)
Returns the member type teamServiceType is built around, or null when it cannot
be determined — a service deriving straight from TeamServiceBase, which is generic in
nothing and so carries no member type to find.
public static Type Resolve(Type teamServiceType)
Parameters
teamServiceTypeType
Returns
Remarks
Walks the base chain rather than the interfaces: the member type is a type argument of the storage
base (TeamServiceRepositoryBase<TEntity, TMember>), which is what every host deriving
from a storage package has. The first argument assignable to ITeamMember wins.
ResolveOrDefault(Type, Type)
The member type to register for teamServiceType: the inferred one, else
fallback.
public static Type ResolveOrDefault(Type teamServiceType, Type fallback)