I have this code in many places. Is there any more compact way to get manager that doesn't do caching?
var queryStrategy = new QueryStrategy(
FetchStrategy.DataSourceOnly,
MergeStrategy.PreserveChanges,
QueryInversionMode.Manual,
TransactionSettings.Default,
CacheQueryOptions.Default);
this.entityManager =
new IDATTApplicationEntities(modelService.ApplicationEntityManager)
{
DefaultQueryStrategy = queryStrategy
};
Question #2:
I have "messageService" inside my app and I poll for new messages every X minutes. I take timestamp of last message and use it for query parameter. So, for example if latest message was created at 10pm - in 10 minutes I will query again to check if there was messages created after 10pm. IdeaBlade would cache this query but since there was no messages - I will retry in 10 minutes and get nothing because query goes directly to cache. Is that scenario good example when cache need to be turned off?