Esempio n. 1
0
        public Database(string name, Guid id,
                        List <Table> tables, DbSchema schema,
                        List <Participant> acceptedParticipants,
                        List <Participant> pendingParticipants,
                        Contract contract, Process process) : this(name, process)
        {
            _id     = id;
            _tables = tables;
            _schema = schema;

            if (acceptedParticipants is null)
            {
                acceptedParticipants = new List <Participant>();
            }

            if (pendingParticipants is null)
            {
                pendingParticipants = new List <Participant>();
            }

            if (contract is null)
            {
                contract = new Contract(_process, this);
            }

            _participantManager = new ParticipantManager(this, acceptedParticipants, pendingParticipants, _process);
            _contract           = contract;

            _process = process;
            SetProcessForParticipants();
        }
Esempio n. 2
0
 public Database(string name, Guid id,
                 List <Table> tables, DbSchema schema, Process process) : this(name, process)
 {
     _id     = id;
     _tables = tables;
     _schema = schema;
     SetProcessForParticipants();
 }
Esempio n. 3
0
        public static DbSchemaInfo Map(DbSchema schema)
        {
            var info = new DbSchemaInfo();

            MapDatabaseInformation(schema, info);
            MapTableInformation(schema, info);

            return(info);
        }
Esempio n. 4
0
 public Database(string name, Guid id,
                 List <Table> tables, DbSchema schema,
                 List <Participant> acceptedParticipants, Process process) : this(name, process)
 {
     _id                 = id;
     _tables             = tables;
     _schema             = schema;
     _participantManager = new ParticipantManager(this, acceptedParticipants, new List <Participant>(), _process);
     SetProcessForParticipants();
 }
Esempio n. 5
0
        private static void MapTableInformation(DbSchema schema, DbSchemaInfo info)
        {
            foreach (var table in schema.Tables)
            {
                var tSchema = new TableSchemaInfo();
                tSchema.TableName = table.TableName;
                MapColumnInformation(table, tSchema);

                info.Tables.Add(tSchema);
            }
        }
Esempio n. 6
0
        public PartialDatabase(Process process)
        {
            _id      = Guid.NewGuid();
            _process = process;
            _tables  = new List <Table>();

            if (_schema is null)
            {
                _schema = new DbSchema(this, _process);
            }

            if (_contract is null)
            {
                _contract = new Contract(_process);
            }
        }
Esempio n. 7
0
        public Database(Process process)
        {
            Tables2             = new List <Table2>();
            _process            = process;
            _id                 = Guid.NewGuid();
            _tables             = new List <Table>();
            _participantManager = new ParticipantManager(this, new List <Participant>(), new List <Participant>(), _process);

            if (_schema is null)
            {
                _schema = new DbSchema(this, _process);
            }

            if (_contract is null)
            {
                _contract = new Contract(_process);
            }

            SetProcessForParticipants();
        }
Esempio n. 8
0
 private static void MapDatabaseInformation(DbSchema schema, DbSchemaInfo info)
 {
     info.DatabaseId   = schema.DatabaseId;
     info.DatabaseName = schema.DatabaseName;
 }
Esempio n. 9
0
 public void UpdateSchema()
 {
     _schema = new DbSchema(this, _process);
 }