Auto-set CreatedAt/UpdatedAt via EF interceptor; standardize timestamp names across entities
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user