From 0c8ab07c64de024c942ca8fe57cf5fc1cf558bc5 Mon Sep 17 00:00:00 2001 From: Dao Yu Lai Date: Fri, 20 Dec 2024 13:29:47 -0800 Subject: [PATCH] MMI-244 Renamed Cbra methods --- libs/net/dal/Services/TimeTrackingService.cs | 10 +++--- libs/net/dal/TNOContext.cs | 35 +++++++++++--------- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/libs/net/dal/Services/TimeTrackingService.cs b/libs/net/dal/Services/TimeTrackingService.cs index 78b7a6280..ad90f080b 100644 --- a/libs/net/dal/Services/TimeTrackingService.cs +++ b/libs/net/dal/Services/TimeTrackingService.cs @@ -30,27 +30,27 @@ public IEnumerable Find(DateTime from, DateTime to) public IEnumerable GetTotalExcerpts(DateTime from, DateTime to) { - return this.Context.fn_cbra_report_total_excerpts(DateOnly.FromDateTime(from), DateOnly.FromDateTime(to)).ToArray(); + return this.Context.GetCbraReportTotalExcerpts(DateOnly.FromDateTime(from), DateOnly.FromDateTime(to)).ToArray(); } public IEnumerable GetStaffSummary(DateTime from, DateTime to) { - return this.Context.fn_cbra_report_staff_summary(DateOnly.FromDateTime(from), DateOnly.FromDateTime(to)).ToArray(); + return this.Context.GetCbraReportStaffSummary(DateOnly.FromDateTime(from), DateOnly.FromDateTime(to)).ToArray(); } public IEnumerable GetTotalsByProgram(DateTime from, DateTime to) { - return this.Context.fn_cbra_report_totals_by_program(DateOnly.FromDateTime(from), DateOnly.FromDateTime(to)).ToArray(); + return this.Context.GetCbraReportTotalsByProgram(DateOnly.FromDateTime(from), DateOnly.FromDateTime(to)).ToArray(); } public IEnumerable GetTotalsByBroadcaster(DateTime from, DateTime to) { - return this.Context.fn_cbra_report_totals_by_broadcaster(DateOnly.FromDateTime(from), DateOnly.FromDateTime(to)).ToArray(); + return this.Context.GetCbraReportTotalsByBroadcaster(DateOnly.FromDateTime(from), DateOnly.FromDateTime(to)).ToArray(); } public IEnumerable GetTotalEntries(DateTime from, DateTime to) { - return this.Context.fn_cbra_report_total_entries(DateOnly.FromDateTime(from), DateOnly.FromDateTime(to)).ToArray(); + return this.Context.GetCbraReportTotalEntries(DateOnly.FromDateTime(from), DateOnly.FromDateTime(to)).ToArray(); } #endregion } diff --git a/libs/net/dal/TNOContext.cs b/libs/net/dal/TNOContext.cs index 88b2a916a..1c9f6a631 100644 --- a/libs/net/dal/TNOContext.cs +++ b/libs/net/dal/TNOContext.cs @@ -86,16 +86,16 @@ public class TNOContext : DbContext #endregion #region ReportResults - public IQueryable fn_cbra_report_staff_summary(DateOnly from, DateOnly to) - => FromExpression(() => fn_cbra_report_staff_summary(from, to)); - public IQueryable fn_cbra_report_totals_by_broadcaster(DateOnly from, DateOnly to) - => FromExpression(() => fn_cbra_report_totals_by_broadcaster(from, to)); - public IQueryable fn_cbra_report_totals_by_program(DateOnly from, DateOnly to) - => FromExpression(() => fn_cbra_report_totals_by_program(from, to)); - public IQueryable fn_cbra_report_total_excerpts(DateOnly from, DateOnly to) - => FromExpression(() => fn_cbra_report_total_excerpts(from, to)); - public IQueryable fn_cbra_report_total_entries(DateOnly from, DateOnly to) - => FromExpression(() => fn_cbra_report_total_entries(from, to)); + public IQueryable GetCbraReportStaffSummary(DateOnly from, DateOnly to) + => FromExpression(() => GetCbraReportStaffSummary(from, to)); + public IQueryable GetCbraReportTotalsByBroadcaster(DateOnly from, DateOnly to) + => FromExpression(() => GetCbraReportTotalsByBroadcaster(from, to)); + public IQueryable GetCbraReportTotalsByProgram(DateOnly from, DateOnly to) + => FromExpression(() => GetCbraReportTotalsByProgram(from, to)); + public IQueryable GetCbraReportTotalExcerpts(DateOnly from, DateOnly to) + => FromExpression(() => GetCbraReportTotalExcerpts(from, to)); + public IQueryable GetCbraReportTotalEntries(DateOnly from, DateOnly to) + => FromExpression(() => GetCbraReportTotalEntries(from, to)); #endregion #region Reports @@ -191,15 +191,20 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.ApplyAllConfigurations(typeof(ContentConfiguration), this); modelBuilder.HasDbFunction(typeof(TNOContext) - .GetMethod(nameof(fn_cbra_report_staff_summary), new[] {typeof(DateOnly), typeof(DateOnly)})); + .GetMethod(nameof(GetCbraReportStaffSummary), new[] {typeof(DateOnly), typeof(DateOnly)})) + .HasName("fn_cbra_report_staff_summary"); modelBuilder.HasDbFunction(typeof(TNOContext) - .GetMethod(nameof(fn_cbra_report_total_entries), new[] {typeof(DateOnly), typeof(DateOnly)})); + .GetMethod(nameof(GetCbraReportTotalEntries), new[] {typeof(DateOnly), typeof(DateOnly)})) + .HasName("fn_cbra_report_total_entries"); modelBuilder.HasDbFunction(typeof(TNOContext) - .GetMethod(nameof(fn_cbra_report_total_excerpts), new[] {typeof(DateOnly), typeof(DateOnly)})); + .GetMethod(nameof(GetCbraReportTotalExcerpts), new[] {typeof(DateOnly), typeof(DateOnly)})) + .HasName("fn_cbra_report_total_excerpts"); modelBuilder.HasDbFunction(typeof(TNOContext) - .GetMethod(nameof(fn_cbra_report_totals_by_broadcaster), new[] {typeof(DateOnly), typeof(DateOnly)})); + .GetMethod(nameof(GetCbraReportTotalsByBroadcaster), new[] {typeof(DateOnly), typeof(DateOnly)})) + .HasName("fn_cbra_report_totals_by_broadcaster"); modelBuilder.HasDbFunction(typeof(TNOContext) - .GetMethod(nameof(fn_cbra_report_totals_by_program), new[] {typeof(DateOnly), typeof(DateOnly)})); + .GetMethod(nameof(GetCbraReportTotalsByProgram), new[] {typeof(DateOnly), typeof(DateOnly)})) + .HasName("fn_cbra_report_totals_by_program"); modelBuilder.Entity().HasNoKey().ToView(null); modelBuilder.Entity().HasNoKey().ToView(null);