Skip to content

DovetailJointMetadata Methods

ClassMethods3 members
Container for conventions
FromFactory(Func<IServiceProvider, IDovetailJoint>, DovetailHostType, DovetailCategory)Section titled FromFactory(Func<IServiceProvider, IDovetailJoint>, DovetailHostType, DovetailCategory)staticDovetailJointMetadata
Describes a joint that is created the first time DovetailJointMetadata.Joint is read, rather than up front.
public sealed class DovetailJointMetadata
{
public static DovetailJointMetadata FromFactory(
Func<IServiceProvider, IDovetailJoint> factory,
DovetailHostType hostType,
DovetailCategory category)
{
// ...
}
}
factoryFunc<IServiceProvider, IDovetailJoint>Creates the joint from the properties of the context builder.
hostTypeDovetailHostTypeThe host type the convention applies to.
categoryDovetailCategoryThe category the convention belongs to.
DovetailJointMetadataThe metadata of the joint factory creates.
ArgumentNullExceptionfactory is null.
This is how the code generated for an exported joint with constructor parameters creates it: the factory resolves each parameter from the properties of the DovetailContextBuilder the metadata was given to, so a value set on the builder after the metadata was created is still seen. A parameter with a default value falls back to it when the properties hold nothing of that type, and a parameter without one makes the factory throw InvalidOperationException. Read before a builder has the metadata, DovetailJointMetadata.Joint resolves against empty properties. The joint is created once.
GetHashCodeSection titled GetHashCodeoverrideint
Serves as the default hash function.
public sealed class DovetailJointMetadata
{
public override int GetHashCode()
{
// ...
}
}
intA hash code for the current object.
Adds a new dependency to the list
public sealed class DovetailJointMetadata
{
public DovetailJointMetadata WithDependency(
DependencyDirection direction,
Type type)
{
// ...
}
}
directionDependencyDirectionThe direction of the dependency.
typeTypeThe IDovetailJoint type that this dependency relates to.