0

I'm glad to set common cache for almost all the entity like the following with Fluent NHibernate:

    public static FluentConfiguration Create(string connStr)
    {
        return Fluently.Configure()
          .Cache(x => x.UseSecondLevelCache().ProviderClass<SysCacheProvider>())
          .Mappings(m =>
              {
                  m.FluentMappings
                      .AddFromAssemblyOf<UserMap>()
                      .Conventions.Add(
                        // here the cache is set ReadWrite
                        Cache.Is(x => x.ReadWrite()),
                      );

              })
    }

But there is still some entities that I DO NOT want to cache them. How should I do?

public class ActivityMap : EntityMap<Activity>
{
    public ActivityMap()
    {
        References<User>(m => m.Executor);

        //Note: I'm not want to change the cache but REMOVE the cache!
        //Cache.ReadOnly();
    }
}
freeflying
  • 215
  • 3
  • 12

1 Answers1

0

I'm not sure it's a real solution or just a walk around that is to set the expiration=0 in the cache region node in web.config, but whatever it works.

freeflying
  • 215
  • 3
  • 12