The applicationDbContext
public class ApplicationDbContext : DbContext
{
public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options) : base(options)
{ }
public DbSet<wSerie> wSeries { get; set; }
public DbSet<wPreliminaire> wPreliminaires { get; set; }
public DbSet<FileTableRoot> FileTableRoot { get; set; }
public DbSet<FileTableFilePath> FileTableFilePaths { get; set; }
public DbSet<FilePath> FilePaths { get; set; }
public DbSet<FilePathP> FilePathPs { get; set; }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<wSerie>().HasNoKey().ToTable("wSerie", t => t.ExcludeFromMigrations());
modelBuilder.Entity<wPreliminaire>().HasNoKey().ToTable("wPreliminaire", t => t.ExcludeFromMigrations());
modelBuilder.Entity<FileTableRoot>().HasNoKey().ToTable("FileTableRoot", t => t.ExcludeFromMigrations());
modelBuilder.Entity<FileTableFilePath>().HasNoKey().ToTable("FileTableFilePath", t => t.ExcludeFromMigrations());
modelBuilder.Entity<FilePath>().HasNoKey().ToTable("FilePath", t => t.ExcludeFromMigrations());
modelBuilder.Entity<FilePathP>().HasNoKey().ToTable("FilePathP", t => t.ExcludeFromMigrations());
base.OnModelCreating(modelBuilder);
}
}
The FilePathP is come from the sqlView with the definition.
In addition as seen on type.Name a getting the null value which causing the error.
The type.Name is not NULL the value is annulé
and the Type = NULL because it's repository
I think I try to change foreach (FilePathP type in context.FilePathPs)
by foreach (FilePathP genre in context.FilePathPs)
==> I tried it ; it does not change anything but it avoids the mistakes of interpretation
I added the break point to see TreeViewJSON the result seems OK at the line 11 the resultat is