Possibly fix issues
After doing testing with a test project, re-organized code to new method of storing, as well as ensure that all Endpoint lambda's are separated out into functions. Large commit, will be testing.
This commit is contained in:
parent
2e4f644c17
commit
73955353cb
23 changed files with 314 additions and 352 deletions
|
|
@ -1,4 +1,4 @@
|
|||
using FreeTubeSync.Model.Database;
|
||||
using FreeTubeSync.Model;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace FreeTubeSync.Database;
|
||||
|
|
@ -13,10 +13,10 @@ public class DataContext : DbContext
|
|||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.Entity<Profile>()
|
||||
.Navigation(e => e.subscriptions).AutoInclude();
|
||||
.OwnsMany<Subscription>(o => o.subscriptions);
|
||||
|
||||
modelBuilder.Entity<Playlist>()
|
||||
.Navigation(e => e.videos).AutoInclude();
|
||||
.OwnsMany<Video>(o => o.videos);
|
||||
}
|
||||
|
||||
public override int SaveChanges()
|
||||
|
|
@ -71,7 +71,5 @@ public class DataContext : DbContext
|
|||
public DbSet<Profile> Profiles { get; set; }
|
||||
public DbSet<SearchHistory> SearchHistories { get; set; }
|
||||
public DbSet<Setting> Settings { get; set; }
|
||||
public DbSet<Subscription> Subscriptions { get; set; }
|
||||
public DbSet<Video> Videos { get; set; }
|
||||
public DbSet<ChangeLog> ChangeLogs { get; set; }
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue