- ABP Framework version: v7.3.2
- UI Type: MVC
- Database System: EF Core (SQL Server)
- Tiered (for MVC) or Auth Server Separated (for Angular): no
I have included the file management module in my solution and I would like to create a table for Media which has a navigation property to the files stored in FmFileDescriptors. My solution would allow for upload reports/images/videos which are stored in the files table, but I am creating a gallery on top of the files using the Media table as my gallery source. I would prefer not to use the files tables directly as I need to make many modifications to the schema as well as have other related tables for meta data (EXIF data) and tagging data.
5 Answer(s)
-
0
Hi,
May I ask what blocked you?
-
0
I am not sure how to add the navigation property to the file management entities. I cannot see them in the list.
-
0
Hi,
You can try:
... [ReplaceDbContext(typeof(IFileManagementDbContext))] public class YourDbcontext: ..... IFileManagementDbContext { ..... public DbSet<FileMataData> FileMataData {get; set;} protected override void OnModelCreating(ModelBuilder builder) { base.OnModelCreating(builder); ..... builder.Entity<FileMataData>(b => { b.ToTable(MyProjectNameConsts.DbTablePrefix + "FileMataData", MyProjectNameConsts.DbSchema); b.HasOne(e => e.File).WithOne(); b.ConfigureByConvention(); //auto configure for the base class props }); } }
public class FileMataData: Entity<Guid> { public Guid FileId { get; set; } public FileDescriptor File { get; set;} ..... }
-
0
aaah I assume you have to do it without using the abp suite?
-
0
Hi,
Yes