Quantcast
Channel: Entity Framework
Viewing all articles
Browse latest Browse all 10318

Created Issue: Generate pre-compiled views on the fly as needed instead of requiring manual use of the power tools extension [629]

$
0
0
One of the things blocking the use of pre-compiled views for us at work is the fact that there's no easy way to automate it. It looks like the current implementation of pre-compiled views is something like:

1. Fetch all view container types using the attributes on the assembly.
2. Find the first whose name matches.
3. Check it's hashes: if they match, use it. If not, throw and exception.

I propose that this behavior instead be changed to:

1. Compute the relevant hashes.
2. Look outside the assembly for a plain-text views file with a certain name based on hashes (and whose directory might be based on an assembly).
3. If the views file matches, read it in (a custom EntityViewContainer could be used for this) and use it. Otherwise, build views as normal, and then afterwords generate a file to save those views.

One challenge would be making sure that dead views files get cleaned up.

This behavior seems like it would be preferable to the current process in nearly all situations, and would also solve the problem of very large views .cs files using up too much string space (I believe I saw this mentioned in another issue).

Viewing all articles
Browse latest Browse all 10318

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>