Beispiel #1
0
        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity <Task>().HasIndex(t => t.ProjectId);
            modelBuilder.Entity <Tracking>().HasIndex(t => new { t.TaskId, t.UserId });

            modelBuilder.Entity <Project>().HasMany(p => p.Tasks).WithOne(t => t.Project);
            modelBuilder.Entity <User>().HasMany(u => u.Trackings).WithOne(t => t.User);

            IndexHelper.BuildIndexes <TimeTrackingContext>(modelBuilder);
        }