DovetailJointMetadata Methods
ClassMethods3 members
Container for conventions
FromFactory(Func<IServiceProvider, IDovetailJoint>, DovetailHostType, DovetailCategory) Section titled FromFactory(Func<IServiceProvider, IDovetailJoint>, DovetailHostType, DovetailCategory)staticDovetail 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) { // ... }}Parameters
factoryFunc<IServiceProvider, IDovetailJoint> Creates the joint from the properties of the context builder.hostType DovetailcategoryDovetailReturns
DovetailJointMetadata The metadata of the joint factory creates.Exceptions
ArgumentNullExceptionfactory is null.Remarks
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. Serves as the default hash function.
public sealed class DovetailJointMetadata{ public override int GetHashCode() { // ... }}Returns
intA hash code for the current object.WithDependency(DependencyDirection, Type) Section titled WithDependency(DependencyDirection, Type)Dovetail Adds a new dependency to the list
public sealed class DovetailJointMetadata{ public DovetailJointMetadata WithDependency( DependencyDirection direction, Type type) { // ... }}Parameters
directionDependencytypeTypeThe IDovetailJoint type that this dependency relates to.Returns
DovetailJointMetadata This DovetailJointMetadata , for chaining.