File tree Expand file tree Collapse file tree
PocketDDD.BlazorClient/PocketDDD.BlazorClient/Services
PocketDDD.Server/PocketDDD.Server.Services Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ public void SetUserAuthToken(string token)
2626 new EventDataResponseDTO
2727 {
2828 Id = 1 ,
29- Version = 1 ,
29+ Version = 0 , //Set to 0 so if we ever connect this to a real API then it will update!
3030 TimeSlots = new [ ]
3131 {
3232 new TimeSlotDTO
Original file line number Diff line number Diff line change @@ -60,14 +60,15 @@ public async Task UpdateFromSessionize()
6060
6161 if ( dbContext . ChangeTracker . HasChanges ( ) )
6262 {
63+ dbEvent . Version ++ ;
6364 Logger . LogInformation ( "Updating db with changes to rooms" ) ;
6465 await dbContext . SaveChangesAsync ( ) ;
6566 }
6667 else
6768 {
6869 Logger . LogInformation ( "No changes to rooms were detected" ) ;
6970 }
70-
71+
7172 Logger . LogInformation ( "Looking for changes to time slots and breaks" ) ;
7273
7374 var dbTimeSlots = await dbContext . TimeSlots . ToListAsync ( ) ;
@@ -93,8 +94,10 @@ public async Task UpdateFromSessionize()
9394
9495 dbTimeSlot . Info = item . isServiceSession ? item . serviceSessionDetails : null ;
9596 }
97+
9698 if ( dbContext . ChangeTracker . HasChanges ( ) )
9799 {
100+ dbEvent . Version ++ ;
98101 Logger . LogInformation ( "Updating db with changes to time slots and breaks" ) ;
99102 await dbContext . SaveChangesAsync ( ) ;
100103 }
@@ -135,8 +138,10 @@ public async Task UpdateFromSessionize()
135138 dbSession . Track = dbTracks . Single ( x => x . SessionizeId == item . roomId ) ;
136139 dbSession . TimeSlot = GetTimeSlot ( dbTimeSlots , item . startsAt , item . endsAt ) ;
137140 }
141+
138142 if ( dbContext . ChangeTracker . HasChanges ( ) )
139143 {
144+ dbEvent . Version ++ ;
140145 Logger . LogInformation ( "Updating db with changes to sessions" ) ;
141146 await dbContext . SaveChangesAsync ( ) ;
142147 }
You can’t perform that action at this time.
0 commit comments