Repository navigation
Conversation
| /// <param name="keyPrefix">The prefix to prepend to all lock names.</param> | ||
| /// <returns>A new <see cref="IDistributedLockProvider" /> that prepends <paramref name="keyPrefix" /> to all lock names.</returns> | ||
| /// <exception cref="ArgumentNullException"></exception> | ||
| public static IDistributedLockProvider WithKeyPrefix(this IDistributedLockProvider provider, string keyPrefix) |
There was a problem hiding this comment.
WithNamePrefix would be a better fit with the rest of the library's naming conventions
|
Thanks for sharing @gliljas this is an interesting idea for the feature. The API is the tricky part: having multiple same-named extensions for different interfaces in different namespaces feels like it could easily confuse someone. It's also unfortunate that applying this to, say, a We could implement this as new constructor option on all providers, but then you lose the ability to decorate an arbitrary provider. It's possible that this is best as a user-land implementation, since a user who needs for any particular combination of the interfaces can easily build the decorator themselves. I'll keep thinking about it. Open to other clever solutions as well. |
I struggled to understand what you meant, but then I realized that you're referring to using the "SynchronizationProvider" as is, and not the abstractions it exposes. |
Modeled after the key prefix feature in StackExchange Redis