Skip to content

Commit

Permalink
MMI-244 Renamed Cbra methods
Browse files Browse the repository at this point in the history
  • Loading branch information
laidaoyu committed Dec 20, 2024
1 parent 1278e16 commit 0c8ab07
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 20 deletions.
10 changes: 5 additions & 5 deletions libs/net/dal/Services/TimeTrackingService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,27 +30,27 @@ public IEnumerable<TimeTracking> Find(DateTime from, DateTime to)

public IEnumerable<CBRAReportTotalExcerpts> 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<CBRAReportStaffSummary> 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<CBRAReportTotalsByProgram> 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<CBRAReportTotalsByBroadcaster> 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<CBRAReportTotalEntries> 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
}
35 changes: 20 additions & 15 deletions libs/net/dal/TNOContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,16 @@ public class TNOContext : DbContext
#endregion

#region ReportResults
public IQueryable<CBRAReportStaffSummary> fn_cbra_report_staff_summary(DateOnly from, DateOnly to)
=> FromExpression(() => fn_cbra_report_staff_summary(from, to));
public IQueryable<CBRAReportTotalsByBroadcaster> fn_cbra_report_totals_by_broadcaster(DateOnly from, DateOnly to)
=> FromExpression(() => fn_cbra_report_totals_by_broadcaster(from, to));
public IQueryable<CBRAReportTotalsByProgram> fn_cbra_report_totals_by_program(DateOnly from, DateOnly to)
=> FromExpression(() => fn_cbra_report_totals_by_program(from, to));
public IQueryable<CBRAReportTotalExcerpts> fn_cbra_report_total_excerpts(DateOnly from, DateOnly to)
=> FromExpression(() => fn_cbra_report_total_excerpts(from, to));
public IQueryable<CBRAReportTotalEntries> fn_cbra_report_total_entries(DateOnly from, DateOnly to)
=> FromExpression(() => fn_cbra_report_total_entries(from, to));
public IQueryable<CBRAReportStaffSummary> GetCbraReportStaffSummary(DateOnly from, DateOnly to)
=> FromExpression(() => GetCbraReportStaffSummary(from, to));
public IQueryable<CBRAReportTotalsByBroadcaster> GetCbraReportTotalsByBroadcaster(DateOnly from, DateOnly to)
=> FromExpression(() => GetCbraReportTotalsByBroadcaster(from, to));
public IQueryable<CBRAReportTotalsByProgram> GetCbraReportTotalsByProgram(DateOnly from, DateOnly to)
=> FromExpression(() => GetCbraReportTotalsByProgram(from, to));
public IQueryable<CBRAReportTotalExcerpts> GetCbraReportTotalExcerpts(DateOnly from, DateOnly to)
=> FromExpression(() => GetCbraReportTotalExcerpts(from, to));
public IQueryable<CBRAReportTotalEntries> GetCbraReportTotalEntries(DateOnly from, DateOnly to)
=> FromExpression(() => GetCbraReportTotalEntries(from, to));
#endregion

#region Reports
Expand Down Expand Up @@ -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<CBRAReportStaffSummary>().HasNoKey().ToView(null);
modelBuilder.Entity<CBRAReportTotalEntries>().HasNoKey().ToView(null);
Expand Down

0 comments on commit 0c8ab07

Please sign in to comment.