Skip to content

Commit

Permalink
added ticket price computed column
Browse files Browse the repository at this point in the history
  • Loading branch information
AndriyBorkovich committed May 2, 2024
1 parent 05da865 commit 4f8b0f5
Show file tree
Hide file tree
Showing 4 changed files with 803 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/BSMS.Infrastructure/Persistence/BusStationContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,9 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
modelBuilder.Entity<Route>()
.Property(r => r.OverallDistance)
.HasComputedColumnSql("dbo.CalculateTotalDistanceForRoute([RouteId])");

modelBuilder.Entity<Ticket>()
.Property(t => t.Price)
.HasComputedColumnSql("dbo.CalculateTicketPrice([EndStopId])");
}
}
Loading

0 comments on commit 4f8b0f5

Please sign in to comment.