Open tomvanoost opened 4 years ago
Can you provide more details for reproduction of your problem?
I'm getting the same error.
Repro:
using FileContextCore;
using Microsoft.EntityFrameworkCore;
using System;
using System.Threading.Tasks;
namespace FileContextError
{
class Program
{
static async Task Main(string[] args)
{
var dbContextOptionsBuilder = new DbContextOptionsBuilder<Db>().UseFileContextDatabase();
using var db = new Db(dbContextOptionsBuilder.Options);
db.AddRange(
new ChildClass(),
new ChildClass(),
new ChildClass(),
new ChildClass()
);
await db.SaveChangesAsync();
}
}
class Db : DbContext
{
public Db(DbContextOptions<Db> options) : base(options){}
public DbSet<BaseClass> BaseClasses { get; set; }
public DbSet<ChildClass> ChildClasses { get; set; }
}
public abstract class BaseClass
{
public Guid Id { get; protected set; }
}
public class ChildClass : BaseClass
{
public string Name { get; set; }
}
}
Obs: The error starts to occur when defining any property in the child class.
Hi. Thank you for the reproduction. That's something I can work with. I'll take a look into it.
Great library! I really could use it on the project i am working at. But i have the same problem with inheritance. Any update comming soon to resolve this issue? Thanks!
Great job!
Does this library support inheritance? When I use inheritance I get an IndexOutOfRangeException.
Details: