My question is in regarids to how the 2nd level cache might behave with an OpenAccessLinqDataSource
using a view. So, for example I have two tables in the database:
Cars and Category
I also have a view that combines the two as viewCarsAndCategories.
So, let's say I make a change to Cars and save that like this: databaseContext.SaveChanges();
The 2nd level cache will evict the Cars entities that changed as I understand it. Next time Cars is called new data will be pulled from the database.
But....... the entities belonging to viewCarsAndCategories won't change, and if I am using an OpenAccessLinqDataSource
that uses this view, it will pull old data because the 2nd leve cache doesn't know the view cached data should be evicted.
Is that right?
So.... for the OpenAccessLinqDataSource
to get the new data, I shouldn't use a view. Instead, I should use a custom "GroupBy" parameters like shown here
. for example: the select box
will have the following:
new(CarID, Make, Model, Category.ID, Category.CategoryName)
Now, the OpenAccessLinqDataSource
should be drawing uplon entities that are changed in the 2nd level cache. When I save changes to Cars, the data pulled by my OpenAccessLinqDataSource should also change.
Do I have this correct? WIll this work?