Example #1
0
        public IDatabase CreateDatabase(Domain domain, bool init)
        {
            var domainAssembly = typeof(C1).Assembly;
            var properties = new[]
                {
                    new PropertyDefinition("allors.database.sql.connection", "Integrated Security=SSPI;Data Source=(local);Initial Catalog=adapters;", "System.String"),
                    new PropertyDefinition("allors.database.sqlclient.isolation.level", "Snapshot", "System.Data.IsolationLevel, System.Data")
                };
            var database = new Database.SqlClient.LongId.Database(domain, domainAssembly, Guid.NewGuid(), properties);

            if (init)
            {
                database.Init();
            }

            return database;
        }
Example #2
0
 protected override IDatabase CreateDatabase(Domain domain, bool init)
 {
     return this.profile.CreateDatabase(domain, init);
 }
Example #3
0
        internal void OnDomainCreated(Domain domain)
        {
            this.domains.Add(domain);
            this.metaObjectById.Add(domain.Id, domain);

            this.Stale();
        }
Example #4
0
        private void DeriveSuperdomains(Domain subdomain, HashSet<Domain> superdomains)
        {
            if (this.Equals(subdomain))
            {
                // We have a cycle
                return;
            }

            superdomains.Add(this);

            foreach (var directSuperdomain in this.DirectSuperdomains)
            {
                if (!superdomains.Contains(directSuperdomain))
                {
                    directSuperdomain.DeriveSuperdomains(subdomain, superdomains);
                }
            }
        }
Example #5
0
        public void AddDirectSuperdomain(Domain superdomain)
        {
            if (superdomain.Equals(this) || superdomain.Superdomains.Contains(this))
            {
                throw new Exception("Cyclic in domain inheritance");
            }

            this.directSuperdomains.Add(superdomain);
            this.MetaPopulation.Stale();
        }
Example #6
0
 public static Interface CreateInterface(Domain domain, string name)
 {
     return new InterfaceBuilder(domain, Guid.NewGuid()).WithSingularName(name).WithPluralName(name + "s").Build();
 }
Example #7
0
 public static Class CreateClass(Domain domain, string name)
 {
     return new ClassBuilder(domain, Guid.NewGuid()).WithSingularName(name).WithPluralName(name + "s").Build();
 }