/// <summary> /// Construct a DataCache given data cache preferences. /// </summary> /// <param name="memoryBlock">reference to main memory block</param> /// <param name="dataCachePreferences">the data cache preferences</param> public DataCache(MemoryBlock memoryBlock, DataCachePreferences dataCachePreferences) : base(memoryBlock, dataCachePreferences) { _writePolicy = dataCachePreferences.WritePolicy; _allocatePolicy = dataCachePreferences.AllocatePolicy; _writeThru = (_writePolicy == WritePolicyEnum.WriteThrough); }
/// <summary> /// Initializes a new instance of the <see cref="HostedStorageAttributes" /> class. /// </summary> /// <param name="blobStoreName">Blob store used to store repository contents.</param> /// <param name="strictContentTypeValidation">Whether to validate uploaded content's MIME type appropriate for the repository format (required).</param> /// <param name="writePolicy">Controls if deployments of and updates to assets are allowed (required).</param> public HostedStorageAttributes(string blobStoreName = default(string), bool?strictContentTypeValidation = default(bool?), WritePolicyEnum writePolicy = default(WritePolicyEnum)) { // to ensure "strictContentTypeValidation" is required (not null) if (strictContentTypeValidation == null) { throw new InvalidDataException("strictContentTypeValidation is a required property for HostedStorageAttributes and cannot be null"); } else { this.StrictContentTypeValidation = strictContentTypeValidation; } // to ensure "writePolicy" is required (not null) if (writePolicy == null) { throw new InvalidDataException("writePolicy is a required property for HostedStorageAttributes and cannot be null"); } else { this.WritePolicy = writePolicy; } this.BlobStoreName = blobStoreName; }