Auto-set CreatedAt/UpdatedAt via EF interceptor; standardize timestamp names across entities
This commit is contained in:
@@ -27,7 +27,7 @@ namespace Musify.Application.PlayLists.Handlers
|
||||
var totalCount = await playListsQuery.CountAsync(cancellationToken);
|
||||
|
||||
var pagedPlayLists = await playListsQuery
|
||||
.OrderBy(p => p.CreatedDate)
|
||||
.OrderBy(p => p.CreatedAt)
|
||||
.Select(p => PlayListApplicationResponse.FromEntity(p))
|
||||
.ToPagedListAsync(request.PageNumber, request.PageSize, totalCount, cancellationToken);
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@ namespace Musify.Application.PlayLists.Responses
|
||||
playList.SmallPictureName,
|
||||
playList.MediumPictureName,
|
||||
playList.LargePictureName,
|
||||
playList.CreatedDate,
|
||||
playList.UpdatedDate);
|
||||
playList.CreatedAt,
|
||||
playList.UpdatedAt);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -31,7 +31,7 @@ namespace Musify.Application.Tracks.Handlers
|
||||
var totalCount = await tracksQuery.CountAsync(cancellationToken);
|
||||
|
||||
var pagedTracks = await tracksQuery
|
||||
.OrderBy(t => t.Track.CreatedDate)
|
||||
.OrderBy(t => t.Track.CreatedAt)
|
||||
.Select(t => TrackApplicationResponse.FromEntity(t.Track))
|
||||
.ToPagedListAsync(pageNumber, pageSize, totalCount, cancellationToken);
|
||||
|
||||
|
||||
@@ -5,16 +5,16 @@ namespace Musify.Application.Tracks.Responses
|
||||
public record TrackApplicationResponse(
|
||||
Guid Id,
|
||||
string Title,
|
||||
DateTime CreatedDate,
|
||||
DateTime UpdatedDate)
|
||||
DateTime CreatedAt,
|
||||
DateTime UpdatedAt)
|
||||
{
|
||||
public static TrackApplicationResponse FromEntity(Track track)
|
||||
{
|
||||
return new TrackApplicationResponse(
|
||||
track.Id,
|
||||
track.Title,
|
||||
track.CreatedDate,
|
||||
track.UpdatedDate);
|
||||
track.CreatedAt,
|
||||
track.UpdatedAt);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -63,7 +63,6 @@ namespace Musify.Application.Users.Handlers
|
||||
|
||||
if (hasChanges)
|
||||
{
|
||||
user.UpdatedAt = DateTime.UtcNow;
|
||||
await database.SaveChangesAsync(cancellationToken);
|
||||
logger.LogInformation("Synced profile for user {UserId}", request.Id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user