private NHibernate.Mapping.ByCode.CacheInclude GetNHibernateCacheInclude(CacheAttribute attribute) { switch (attribute.Include) { case CacheInclude.All: return NHibernate.Mapping.ByCode.CacheInclude.All; case CacheInclude.NonLazy: return NHibernate.Mapping.ByCode.CacheInclude.NonLazy; default: throw new NotSupportedException("Not support cache include type: " + attribute.Include + "."); } }
private NHibernate.Mapping.ByCode.CacheUsage GetNHibernateCacheUsage(CacheAttribute attribute) { switch (attribute.Usage) { case CacheUsage.NonstrictReadWrite: return NHibernate.Mapping.ByCode.CacheUsage.NonstrictReadWrite; case CacheUsage.ReadOnly: return NHibernate.Mapping.ByCode.CacheUsage.ReadOnly; case CacheUsage.ReadWrite: return NHibernate.Mapping.ByCode.CacheUsage.ReadWrite; case CacheUsage.Transactional: return NHibernate.Mapping.ByCode.CacheUsage.Transactional; default: throw new NotSupportedException("Not support cache usage type: " + attribute.Usage + "."); } }