コード例 #1
0
        /// <summary>
        /// Reads the identifier of the <paramref name="handlerType"/>.
        /// By default the identifier is <see cref="Type.AssemblyQualifiedName"/>, but
        /// can be overriden using <see cref="IdentifierAttribute"/>.
        /// </summary>
        /// <param name="handlerType">The handler to determine the identifier of.</param>
        /// <returns>The identifier of the <paramref name="handlerType"/> or <c>null</c>.</returns>
        private string FindIdentifier(Type handlerType)
        {
            IdentifierAttribute attribute = handlerType.GetTypeInfo().GetCustomAttribute <IdentifierAttribute>();

            if (attribute != null)
            {
                return(attribute.Value);
            }

            return(null);
        }
コード例 #2
0
 public WhenConstructedWithIdentifierStrategyAndSequenceName()
 {
     this.identifierStrategy  = IdentifierStrategy.Assigned;
     this.sequenceName        = "CustomerIdSequence";
     this.identifierAttribute = new IdentifierAttribute(this.identifierStrategy, this.sequenceName);
 }
コード例 #3
0
 public WhenConstructedWithIdentifierStrategy()
 {
     this.identifierStrategy  = IdentifierStrategy.Assigned;
     this.identifierAttribute = new IdentifierAttribute(this.identifierStrategy);
 }
コード例 #4
0
 public WhenConstructedWithIdentifierStrategyAndSequenceName()
 {
     this.identifierStrategy = IdentifierStrategy.Assigned;
     this.sequenceName = "CustomerIdSequence";
     this.identifierAttribute = new IdentifierAttribute(this.identifierStrategy, this.sequenceName);
 }
コード例 #5
0
 public WhenConstructedWithIdentifierStrategy()
 {
     this.identifierStrategy = IdentifierStrategy.Assigned;
     this.identifierAttribute = new IdentifierAttribute(this.identifierStrategy);
 }