Example #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);
        }
 public WhenConstructedWithIdentifierStrategyAndSequenceName()
 {
     this.identifierStrategy  = IdentifierStrategy.Assigned;
     this.sequenceName        = "CustomerIdSequence";
     this.identifierAttribute = new IdentifierAttribute(this.identifierStrategy, this.sequenceName);
 }
 public WhenConstructedWithIdentifierStrategy()
 {
     this.identifierStrategy  = IdentifierStrategy.Assigned;
     this.identifierAttribute = new IdentifierAttribute(this.identifierStrategy);
 }
 public WhenConstructedWithIdentifierStrategyAndSequenceName()
 {
     this.identifierStrategy = IdentifierStrategy.Assigned;
     this.sequenceName = "CustomerIdSequence";
     this.identifierAttribute = new IdentifierAttribute(this.identifierStrategy, this.sequenceName);
 }
 public WhenConstructedWithIdentifierStrategy()
 {
     this.identifierStrategy = IdentifierStrategy.Assigned;
     this.identifierAttribute = new IdentifierAttribute(this.identifierStrategy);
 }