Exemplo 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();
        }
Exemplo 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();
 }
Exemplo n.º 3
0
        public static DbSchemaInfo Map(DbSchema schema)
        {
            var info = new DbSchemaInfo();

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

            return(info);
        }
Exemplo 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();
 }
Exemplo 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);
            }
        }
Exemplo 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);
            }
        }
Exemplo 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();
        }
Exemplo n.º 8
0
 private static void MapDatabaseInformation(DbSchema schema, DbSchemaInfo info)
 {
     info.DatabaseId   = schema.DatabaseId;
     info.DatabaseName = schema.DatabaseName;
 }
Exemplo n.º 9
0
 public void UpdateSchema()
 {
     _schema = new DbSchema(this, _process);
 }