Skip to content

Instantly share code, notes, and snippets.

@scionwest
Created September 21, 2019 22:11
Show Gist options
  • Save scionwest/429d29e2b595d6ea28977cc441fa35f3 to your computer and use it in GitHub Desktop.
Save scionwest/429d29e2b595d6ea28977cc441fa35f3 to your computer and use it in GitHub Desktop.
public class ProjectEntity
{
public Guid Id { get; set; } = Guid.NewGuid();
public Guid TrackerId { get; set; }
public string Title { get; set; }
public bool IsFlagged { get; set; }
public int Type { get; set; }
public bool IsArchived { get; set; }
public TrackerEntity ProjectTracker { get; set; }
public List<TaskEntity> Tasks { get; set; } = new List<TaskEntity>();
}
public class ProjectEntityTypeConfiguration : IEntityTypeConfiguration<ProjectEntity>
{
public void Configure(EntityTypeBuilder<ProjectEntity> builder)
{
builder.ToTable("Project");
builder.Property(pe => pe.Id)
.IsRequired();
builder.Property(pe => pe.IsArchived)
.IsRequired();
builder.HasOne(pe => pe.ProjectTracker)
.WithOne();
}
}
public class TaskEntity
{
public Guid Id { get; set; } = Guid.NewGuid();
public Guid TrackerId { get; set; }
public Guid TaskGroupId { get; set; }
public string Title { get; set; }
public bool IsComplete { get; set; }
public TrackerEntity TaskTracker { get; set; }
}
public class TaskGroupEntity
{
public Guid Id { get; set; } = Guid.NewGuid();
public Guid ProjectId { get; set; }
public Guid TrackerId { get; set; }
public string Name { get; set; }
public bool IsComplete { get; set; }
public List<TaskEntity> Tasks { get; set; } = new List<TaskEntity>();
public TrackerEntity TaskTracker { get; set; }
}
public class TrackerEntity
{
public Guid Id { get; set; } = Guid.NewGuid();
public DateTime? StartDate { get; set; }
public DateTime? TargetDate { get; set; }
public DateTime? CompletionDate { get; set; }
public int Status { get; set; }
public short PercentageCompleted { get; set; }
public int Priority { get; set; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment