Closed John0King closed 11 months ago
Isn't it better to extend abstraction with a generic method? Like:
GetAsync<T>(string key);
@martelskiy the problem of the <T>
is how to serialize/deserialize the object , there are many way like 'Json', 'XML' , 'ProtoBuf' ,Binary
@martelskiy the problem of the
<T>
is how to serialize/deserialize the object , there are many way like 'Json', 'XML' , 'ProtoBuf' ,Binary
@John0King That could easily be worked around by adding a base class and common overloads, or enums or extension methods. Everyone is converting objects to strings or byte arrays, so why not standardize?
As part of the migration of components from dotnet/extensions to dotnet/runtime (https://github.com/aspnet/Announcements/issues/411) we will be bulk closing some of the older issues. If you are still interested in having this issue addressed, just comment and the issue will be automatically reactivated (even if you aren't the author). When you do that, I'll page the team to come take a look. If you've moved on or workaround the issue and no longer need this change, just ignore this and the issue will be closed in 7 days.
If you know that the issue affects a package that has moved to a different repo, please consider re-opening the issue in that repo. If you're unsure, that's OK, someone from the team can help!
anything new on this ?
Paging @dotnet/extensions-migration ! This issue has been revived from staleness. Please take a look and route to the appropriate repository.
Adding a new API to IDistributedCache
would be extremely breaking so I don't think it's likely, but I'll transfer it over for tracking on the backlog in the dotnet/runtime repo.
@anurse
Adding a new API to IDistributedCache would be extremely breaking
theoretically : yes, fact : no
when people upgrade to a new .net core /asp.net core, there are always breaking changes, for example : EF Core update, but when EF update , the EFCore.SqlServer, EFCore.Sqlite , EFCore.InMemory, and third party like 'EFCore.Npgsql' also update. This is not some kind of remove features, for example : MVC to MVC core , signalR to signalR Core (it's bad example, they are 2 frameworks ), there are manage feature and api not exists in the new api, and I believe people actually need this collection support in caching and they goes to native Redis client library for this feature.
and today the interface can have default implementation,
the default implementation can use System.Text.Json to serialize/deserialize to JSON Array and to store to current GetAsync(byte[])
method
Adding a new API to
IDistributedCache
would be extremely breaking so I don't think it's likely, but I'll transfer it over for tracking on the backlog in the dotnet/runtime repo.
Yes, it would be a breaking change. Since there were not upvotes or any other feedback from other users for over three years I am going to close the issue. I am sorry, but we are not going to implement it in the near future. Thanks!
Both SqlServer and Redis can implement for
Collection
cache , and even union support. Please consinder for add follow api