interactive views

Nov 30, 2015 at 2:24 PM
i'm using a wpf application that reads data by a WCF application hosted in IIS.
To get data from the db I use EF 6.
My application is initial very slow therefore I wanted to use Interactive views. When I start my application the initial call is made and the views are created ( a xml file). When I reset my application pool my program doesn't use the generated views in the xml but it creates again the XML file.
With this code the xml is created:
using (var ctx = new DataReportingContext(request.ConnectInfo))
                    new FileViewCacheFactory(@"d:\log\MyViews.xml"));
How ca I re-use the views so I don't get the initial create of the views?
Jan 13, 2016 at 5:44 PM
If you restart your app/app pool the views should be loaded from the file unless the model has changed. Is the MyViews.xml file being overwritten? If so, can you check if there are any differences between the old and new file?

Jan 14, 2016 at 9:38 AM
Hi ,

The file is not overwritten. But it takes still about 15 seconds after the first call.
Jan 15, 2016 at 5:06 AM
Are you sure this is view generation that is causing startup issues? How big is your model? View generation in EF6 has been greatly improved and should no longer be a problem in case of small to medium (let's say 100 entity sets) models. I would recommend starting from this: and then profiling your code to identify what is really causing the delay and then focus on fixing things (e.g. I saw someone complaining about the first call being slow but it turned out that in the first query they joined 35 tables and compiling this query was causing the issue).

Hope this helps,