I am extending our Commerce dashboard with some extra analytics widgets and was wondering how the repository code is set up for fetching data records.
I am currently writing an extended repository for the purpose of fetching B2B orders (where customers filled in company name).
public class AnalyticsExtensionRepository : IAnalyticsExtensionRepository
{
public void Dispose() => throw new NotImplementedException();
public long GetTotalB2bOrders(
Guid storeId,
DateTime from,
DateTime to)
{
throw new NotImplementedException();
}
public IEnumerable<DateRecord<long>> GetTotalB2bOrdersOverTime(
Guid storeId,
DateTime from,
DateTime to,
int dtOffsetMins)
{
throw new NotImplementedException();
}
}
Is it possible to get a look at how the IAnalyticsRepository methods are build? I would like to build my extension methods in the same manner.
The analytics repository simply performs SQL queries against the database. They may not help you too much though as 1 they are very specific to the report and 2 we use SQLKata as a query builder so that'll probably cause more confusion.
I'd say just get a SQL query working retrieving the data you want to present and then work from there.
Thanks again! I was wondering if I might be missing out on any special magics in there. But it seems like I can just go forward with my own implementation :)
Analytics Repository methods
I am extending our Commerce dashboard with some extra analytics widgets and was wondering how the repository code is set up for fetching data records.
I am currently writing an extended repository for the purpose of fetching B2B orders (where customers filled in company name).
Is it possible to get a look at how the
IAnalyticsRepository
methods are build? I would like to build my extension methods in the same manner.The analytics repository simply performs SQL queries against the database. They may not help you too much though as 1 they are very specific to the report and 2 we use SQLKata as a query builder so that'll probably cause more confusion.
I'd say just get a SQL query working retrieving the data you want to present and then work from there.
Thanks again! I was wondering if I might be missing out on any special magics in there. But it seems like I can just go forward with my own implementation :)
is working on a reply...