/// <summary> /// Initializes a new instance of the <see cref="ClassCacheConfiguration"/> class. /// </summary> /// <param name="clazz">The class full name.</param> /// <param name="usage">Cache strategy.</param> /// <exception cref="ArgumentException">When <paramref name="clazz"/> is null or empty.</exception> public ClassCacheConfiguration(string clazz, EntityCacheUsage usage) { if (string.IsNullOrEmpty(clazz)) throw new ArgumentException("clazz is null or empty.", "clazz"); this.clazz = clazz; this.usage = usage; }
/// <summary> /// Initializes a new instance of the <see cref="CollectionCacheConfiguration"/> class. /// </summary> /// <param name="collection">The cache role.</param> /// <param name="usage">Cache strategy.</param> /// <exception cref="ArgumentException">When <paramref name="collection"/> is null or empty.</exception> public CollectionCacheConfiguration(string collection, EntityCacheUsage usage) { if (String.IsNullOrEmpty(collection)) throw new ArgumentException("collection is null or empty.", "collection"); this.collection = collection; this.usage = usage; }
/// <summary> /// Initializes a new instance of the <see cref="CollectionCacheConfiguration"/> class. /// </summary> /// <param name="collection">The cache role.</param> /// <param name="usage">Cache strategy.</param> /// <exception cref="ArgumentException">When <paramref name="collection"/> is null or empty.</exception> public CollectionCacheConfiguration(string collection, EntityCacheUsage usage) { if (String.IsNullOrEmpty(collection)) { throw new ArgumentException("collection is null or empty.", "collection"); } this.collection = collection; this.usage = usage; }
/// <summary> /// Initializes a new instance of the <see cref="ClassCacheConfiguration"/> class. /// </summary> /// <param name="clazz">The class full name.</param> /// <param name="usage">Cache strategy.</param> /// <exception cref="ArgumentException">When <paramref name="clazz"/> is null or empty.</exception> public ClassCacheConfiguration(string clazz, EntityCacheUsage usage) { if (string.IsNullOrEmpty(clazz)) { throw new ArgumentException("clazz is null or empty.", "clazz"); } this.clazz = clazz; this.usage = usage; }
/// <summary> /// Convert a <see cref="EntityCacheUsage"/> in its xml expected value. /// </summary> /// <param name="value">The <see cref="EntityCacheUsage"/> to convert.</param> /// <returns>The <see cref="EntityCacheUsage"/>.</returns> public static string ToString(EntityCacheUsage value) { switch (value) { case EntityCacheUsage.Readonly: return ReadOnlyXmlValue; case EntityCacheUsage.ReadWrite: return ReadWriteXmlValue; case EntityCacheUsage.NonStrictReadWrite: return NonstrictReadWriteXmlValue; case EntityCacheUsage.Transactional: return TransactionalXmlValue; default: return string.Empty; } }
/// <summary> /// Convert a <see cref="EntityCacheUsage"/> in its xml expected value. /// </summary> /// <param name="value">The <see cref="EntityCacheUsage"/> to convert.</param> /// <returns>The <see cref="EntityCacheUsage"/>.</returns> public static string ToString(EntityCacheUsage value) { switch (value) { case EntityCacheUsage.Readonly: return(ReadOnlyXmlValue); case EntityCacheUsage.ReadWrite: return(ReadWriteXmlValue); case EntityCacheUsage.NonStrictReadWrite: return(NonstrictReadWriteXmlValue); case EntityCacheUsage.Transactional: return(TransactionalXmlValue); default: return(string.Empty); } }
/// <summary> /// Initializes a new instance of the <see cref="CollectionCacheConfiguration"/> class. /// </summary> /// <param name="collection">The cache role.</param> /// <param name="usage">Cache strategy.</param> /// <param name="region">The cache region.</param> /// <exception cref="ArgumentException">When <paramref name="collection"/> is null or empty.</exception> public CollectionCacheConfiguration(string collection, EntityCacheUsage usage, string region) : this(collection, usage) { this.region = region; }
/// <summary> /// Initializes a new instance of the <see cref="ClassCacheConfiguration"/> class. /// </summary> /// <param name="clazz">The class full name.</param> /// <param name="usage">Cache strategy.</param> /// <param name="include">Values for class-cache include.</param> /// <param name="region">The cache region.</param> /// <exception cref="ArgumentException">When <paramref name="clazz"/> is null or empty.</exception> public ClassCacheConfiguration(string clazz, EntityCacheUsage usage, ClassCacheInclude include, string region) : this(clazz, usage, include) { this.region = region; }
/// <summary> /// Initializes a new instance of the <see cref="ClassCacheConfiguration"/> class. /// </summary> /// <param name="clazz">The class full name.</param> /// <param name="usage">Cache strategy.</param> /// <param name="include">Values for class-cache include.</param> /// <exception cref="ArgumentException">When <paramref name="clazz"/> is null or empty.</exception> public ClassCacheConfiguration(string clazz, EntityCacheUsage usage, ClassCacheInclude include) : this(clazz, usage) { this.include = include; }
/// <summary> /// Initializes a new instance of the <see cref="CollectionCacheConfiguration"/> class. /// </summary> /// <param name="collection">The cache role.</param> /// <param name="usage">Cache strategy.</param> /// <param name="region">The cache region.</param> /// <exception cref="ArgumentException">When <paramref name="collection"/> is null or empty.</exception> public CollectionCacheConfiguration(string collection, EntityCacheUsage usage, string region) :this(collection,usage) { this.region = region; }