Add an AttributedTableRepository<T> for easy consumption in DI scenarios
kzu opened this issue · comments
Daniel Cazzulino commented
In DI scenarios, it's virtually impossible to inject a string
with a target table name, or a Func<T, string>
for the functions to retrieve a partition key or row key for an entity.
However, since we provide the corresponding attributes to make this simpler to consume when using the factory methods, we could also just provide a derived implementation that just uses those same defaults always, so registering it for DI is as simple as (for ASP.NET Core for example):
services.AddScoped(typeof(ITableRepository<>), typeof(AttributedTableRepository<>));