Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • anh-duc-le 38 posts 152 karma points
    Feb 06, 2023 @ 16:37
    anh-duc-le
    0

    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).

    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.

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Feb 07, 2023 @ 09:04
    Matt Brailsford
    100

    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.

  • anh-duc-le 38 posts 152 karma points
    Feb 07, 2023 @ 15:20
    anh-duc-le
    0

    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 :)

Please Sign in or register to post replies

Write your reply to:

Draft