Esempio n. 1
0
        private Entity DefineSubmissionWorkflow(SchemaSpecification dbo, Entity session, Entity conference)
        {
            var submission = dbo.CreateEntity("Submission", table =>
            {
                var sessionFk    = table.CreateForeignKey(session);
                var conferenceFk = table.CreateForeignKey(conference);
                var timestamp    = table.CreateDateTime2Column("Timestamp");
                table.CreateUniqueIndex(sessionFk.Column, conferenceFk.Column, timestamp);
            });

            dbo.CreateEntity("SubmissionWithdrawl", table =>
            {
                var fk = table.CreateForeignKey(submission);
                table.CreateUniqueIndex(fk.Column);
            });

            var acceptance = dbo.CreateEntity("Acceptance", table =>
            {
                var fk        = table.CreateForeignKey(submission);
                var timestamp = table.CreateDateTime2Column("Timestamp");
                table.CreateUniqueIndex(fk.Column, timestamp);
            });

            dbo.CreateEntity("AcceptanceWithdrawl", table =>
            {
                var fk = table.CreateForeignKey(acceptance);
                table.CreateUniqueIndex(fk.Column);
            });

            return(acceptance);
        }
Esempio n. 2
0
        private Entity DefineSession(SchemaSpecification dbo, Entity speaker)
        {
            var session = dbo.CreateEntity("Session", table =>
            {
                var fk        = table.CreateForeignKey(speaker);
                var timestamp = table.CreateDateTime2Column("Timestamp");
                table.CreateUniqueIndex(fk.Column, timestamp);
            });

            dbo.CreateMutableProperty(session, "Title", table =>
            {
                table.CreateStringColumn("Title", 255);
            });

            dbo.CreateMutableProperty(session, "Abstract", table =>
            {
                table.CreateStringColumn("Abstract", 2000);
            });

            var deletion = dbo.CreateEntity("SessionDeletion", table =>
            {
                var fk        = table.CreateForeignKey(session);
                var timestamp = table.CreateDateTime2Column("Timestamp");
                table.CreateUniqueIndex(fk.Column, timestamp);
            });

            dbo.CreateEntity("SessionRestoration", table =>
            {
                var fk = table.CreateForeignKey(deletion);
                table.CreateUniqueIndex(fk.Column);
            });

            return(session);
        }
Esempio n. 3
0
        private Entity DefineConference(SchemaSpecification dbo)
        {
            var conference = dbo.CreateEntity("Conference", table =>
            {
                var guid = table.CreateGuidColumn("ConferenceGuid");
                table.CreateUniqueIndex(guid);
            });

            return(conference);
        }
Esempio n. 4
0
        private void DefineSchedule(SchemaSpecification dbo, Entity conference, Entity acceptance)
        {
            var room = dbo.CreateEntity("Room", table =>
            {
                var conferenceId = table.CreateForeignKey(conference);
                var roomNumber   = table.CreateStringColumn("RoomNumber", 50);
                table.CreateUniqueIndex(conferenceId.Column, roomNumber);
            });

            var timeSlot = dbo.CreateEntity("TimeSlot", table =>
            {
                var conferenceId = table.CreateForeignKey(conference);
                var date         = table.CreateDateColumn("Date");
                var time         = table.CreateTimeColumn("Time", fractionalSeconds: 0);
                table.CreateUniqueIndex(conferenceId.Column, date, time);
            });

            dbo.CreateMutableProperty(acceptance, "Schedule", table =>
            {
                table.CreateForeignKey(room);
                table.CreateForeignKey(timeSlot);
            });
        }
Esempio n. 5
0
        private Entity DefineSpeaker(SchemaSpecification dbo)
        {
            var speaker = dbo.CreateEntity("Speaker", table =>
            {
                var userName = table.CreateStringColumn("UserName", 255);
                table.CreateUniqueIndex(userName);
            });

            dbo.CreateMutableProperty(speaker, "Name", table =>
            {
                table.CreateStringColumn("Name", 100);
            });

            return(speaker);
        }