Interface IMemoryCacheEntryBuilder
Used for building Microsoft.Extensions.Caching.Memory.IMemoryCache entry.
Namespace:MyTested.AspNetCore.Mvc.Builders.Contracts.Data
Assembly:MyTested.AspNetCore.Mvc.Caching.dll
Syntax
public interface IMemoryCacheEntryBuilder
Methods
| Improve this Doc View SourceWithAbsoluteExpiration(Nullable<DateTimeOffset>)
Sets the Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions.AbsoluteExpiration value to the built Microsoft.Extensions.Caching.Memory.IMemoryCache entry.
Declaration
IAndMemoryCacheEntryBuilder WithAbsoluteExpiration(DateTimeOffset? absoluteExpiration)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<System.DateTimeOffset> | absoluteExpiration | Absolute expiration value to set. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Data.IAndMemoryCacheEntryBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Data.IAndMemoryCacheEntryBuilder. |
WithAbsoluteExpirationRelativeToNow(Nullable<TimeSpan>)
Sets the Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions.AbsoluteExpirationRelativeToNow value to the built Microsoft.Extensions.Caching.Memory.IMemoryCache entry.
Declaration
IAndMemoryCacheEntryBuilder WithAbsoluteExpirationRelativeToNow(TimeSpan? absoluteExpirationRelativeToNow)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<System.TimeSpan> | absoluteExpirationRelativeToNow | Absolute expiration relative to now value to set. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Data.IAndMemoryCacheEntryBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Data.IAndMemoryCacheEntryBuilder. |
WithPriority(CacheItemPriority)
Sets the Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions.Priority value to the built Microsoft.Extensions.Caching.Memory.IMemoryCache entry.
Declaration
IAndMemoryCacheEntryBuilder WithPriority(CacheItemPriority priority)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Extensions.Caching.Memory.CacheItemPriority | priority | CacheItemPriority value to set. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Data.IAndMemoryCacheEntryBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Data.IAndMemoryCacheEntryBuilder. |
WithSlidingExpiration(Nullable<TimeSpan>)
Sets the Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions.SlidingExpiration value to the built Microsoft.Extensions.Caching.Memory.IMemoryCache entry.
Declaration
IAndMemoryCacheEntryBuilder WithSlidingExpiration(TimeSpan? slidingExpiration)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<System.TimeSpan> | slidingExpiration | Sliding expiration value to set. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Data.IAndMemoryCacheEntryBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Data.IAndMemoryCacheEntryBuilder. |
WithValue(Object)
Sets the value of the built Microsoft.Extensions.Caching.Memory.IMemoryCache entry.
Declaration
IAndMemoryCacheEntryBuilder WithValue(object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value | Cache entry value to set. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Data.IAndMemoryCacheEntryBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Data.IAndMemoryCacheEntryBuilder. |