-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Redis Distributed Cache DistributedCacheEntryOptions #1
Comments
Merhaba, Öncelikle ilginiz için ben teşekkür ediyorum. :) İlk olarak şöyle başlamak istiyorum, Devnot'ta yazdığım yazı StackExchange.Redis ile ilgili. Eğer bu kısımda bir işlem yapmak istiyorsanız cevabı direkt buradan da görebilirsiniz. StringSet (Tabii StringSet burada sadece bir örnek, diğer veri yapılarına göre olan metotlara da göz atılabilir.) Şayet Microsoft.Extensions.Caching.Distributed paketi için soruyorsanız da DistributedCacheEntryOptions sınıfını ilgili cache'i Redis'e atarken kullanabilirsiniz. İlgili sınıfa ait kaynak kodlara da bakıldığında zaten cache'e ait süre bilgileri yer alıyor. Bu da eklenirken belirtilen ifadeler. // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
namespace Microsoft.Extensions.Caching.Distributed
{
/// <summary>
/// Provides the cache options for an entry in <see cref="IDistributedCache"/>.
/// </summary>
public class DistributedCacheEntryOptions
{
private DateTimeOffset? _absoluteExpiration;
private TimeSpan? _absoluteExpirationRelativeToNow;
private TimeSpan? _slidingExpiration;
}
// ....
} // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Threading;
using System.Threading.Tasks;
namespace Microsoft.Extensions.Caching.Distributed
{
/// <summary>
/// Represents a distributed cache of serialized values.
/// </summary>
public interface IDistributedCache
{
/// <summary>
/// Sets a value with the given key.
/// </summary>
/// <param name="key">A string identifying the requested value.</param>
/// <param name="value">The value to set in the cache.</param>
/// <param name="options">The cache options for the value.</param>
void Set(string key, byte[] value, DistributedCacheEntryOptions options);
/// <summary>
/// Sets the value with the given key.
/// </summary>
/// <param name="key">A string identifying the requested value.</param>
/// <param name="value">The value to set in the cache.</param>
/// <param name="options">The cache options for the value.</param>
/// <param name="token">Optional. The <see cref="CancellationToken"/> used to propagate notifications that the operation should be canceled.</param>
/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns>
Task SetAsync(string key, byte[] value, DistributedCacheEntryOptions options, CancellationToken token = default(CancellationToken));
// ...
} |
Merhaba Yusuf Bey,
Makaleniz için öncelikle teşekkür ederim. Kurmuş olduğunuz yapıda DistributedCacheEntryOptions parametlerini hangi aşamada eklemeliyiz yardımcı olurmusunuz?
İyi Çalışmalar
The text was updated successfully, but these errors were encountered: