WayneBrantley wrote:
Well, I had already read that.
I have now read it like 5 more times.
So, you are saying that if the result of the function HAPPENS to be the same structure as an existing Entity, then it will show up under Linq?
No, you have to set the return type of the TVF call in the designer to an existing entity. This is possible, have an entity mapped onto a table and also on a tvf call result. The mappings for the tvf call result are done with the tvf call, the mappings to the table (normal mappings) are done in the normal mappings tab of the entity.
IMHO, That is not 'explained' very well at all. This is also a pretty limiting factor as very few of my TVF would return an existing Entity.
Linq only works with entities, so if a tvf call has to be called in linq, it has to return an entity. It's how the linq engine works (and it takes a tremendous amount of work to change that, so we're not doing that soon)
Really need to have this as a Linq option even though it maps to a typedview (that designer created). Of course we need typedviews as Linq items without mapping to an entity (or as I have suggested even supporting 'read only' entities - which are essentially views - but with full linq capabilities).
We'll see what we can do. Read only entities are planned for v4.2, we haven't designed that feature yet, but you do bring up a good point: if the entity is the return type of a TVF, then it doesn't have to be mapped onto a table/view as it's already mapped, making it effectively a readonly entity.