Esempio n. 1
0
        public EntityType(string entityTypeName,
                          string domainParentName     = @"",
                          string connectionStringName = @"",
                          string storageType          = @"BlobStream",
                          ProjectionDefinitions projectionDefinitions = null,
                          ClassifierDefinitions classifierDefinitions = null,
                          EventTypes eventTypes = null,
                          IdentifierGroupDefinitions identifierGroupDefinitions = null)
        {
            _entityTypeName = entityTypeName;
            if (!string.IsNullOrWhiteSpace(connectionStringName))
            {
                _connectionStringName = connectionStringName;
            }
            else
            {
                // make a default connection string to use
                _connectionStringName = ConnectionStringNameAttribute.DefaultConnectionStringName(domainParentName, entityTypeName);
            }
            if (!string.IsNullOrWhiteSpace(storageType))
            {
                _storageType = storageType;
            }

            if (null == projectionDefinitions)
            {
                _projectionDefinitions = new ProjectionDefinitions();
            }
            else
            {
                _projectionDefinitions = projectionDefinitions;
            }

            if (null == classifierDefinitions)
            {
                _classifierDefinitions = new ClassifierDefinitions();
            }
            else
            {
                _classifierDefinitions = classifierDefinitions;
            }

            if (null == eventTypes)
            {
                _eventTypes = new EventTypes();
            }
            else
            {
                _eventTypes = eventTypes;
            }

            if (null == identifierGroupDefinitions)
            {
                _identifierGroupDefinitions = new IdentifierGroupDefinitions();
            }
            else
            {
                _identifierGroupDefinitions = identifierGroupDefinitions;
            }
        }
Esempio n. 2
0
 /// <summary>
 /// Add an identifier group definition to this domain entity type
 /// </summary>
 public static ProjectionDefinitions Add(this ProjectionDefinitions projectionDefinitions, ProjectionDefinition projectionToAdd)
 {
     projectionDefinitions.AddProjectionDefinition(projectionToAdd);
     return(projectionDefinitions);
 }