You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var data = await Context.UserFileSystem()
.Take(100)
.ToListAsync();
If I try to map the function in an EntityTypeConfiguration it immediatly throws and complains that derived types cannot be mapped to functions. Am I missing something in my EntityTypeConfiguration? Mapping to derived types clearly works in the first scenario, why would it be different when directly mapping an EntityType / DbSet.
System.InvalidOperationException
The entity type 'FileSystemArchiveVirtual' is mapped to the 'DbFunction' named 'fn_filesystem', but is derived from 'FileSystemObject'. Derived entity types cannot be mapped to a function.
Here you simply seem to be invoking the UserFileSystem() function, as a plain .NET function; whatever its .NET implementation is will get executed; you should be able to remove HasDbFunction: that's about allowing the function in question to be used inside LINQ queries. In other words, your TVF function here really being "mapped" at all (or at least, you're not using it as such).
If I define a a TVF on the context it is usable and handles inheritance and materialization correctly.
If I try to map the function in an EntityTypeConfiguration it immediatly throws and complains that derived types cannot be mapped to functions. Am I missing something in my EntityTypeConfiguration? Mapping to derived types clearly works in the first scenario, why would it be different when directly mapping an EntityType / DbSet.
The text was updated successfully, but these errors were encountered: