improve ReadShowDto.cs
This commit is contained in:
@@ -16,6 +16,13 @@ public class GetShowEndpoint(PyroFetesDbContext pyroFetesDbContext):Endpoint<Rea
|
||||
public override async Task HandleAsync(ReadShowDto req, CancellationToken ct)
|
||||
{
|
||||
var show = await pyroFetesDbContext.Shows
|
||||
.Include(s => s.City)
|
||||
.Include(s => s.ShowStaffs)
|
||||
.Include(s => s.ShowTrucks)
|
||||
.Include(s => s.SoundTimecodes)
|
||||
.Include(s => s.ProductTimecodes)
|
||||
.Include(s => s.Contracts)
|
||||
.Include(s => s.ShowMaterials)
|
||||
.Where(a => a.Id == req.Id)
|
||||
.Select(a => new ReadShowDto
|
||||
{
|
||||
@@ -23,7 +30,15 @@ public class GetShowEndpoint(PyroFetesDbContext pyroFetesDbContext):Endpoint<Rea
|
||||
Name = req.Name,
|
||||
Place = req.Place,
|
||||
Description = req.Description,
|
||||
PyrotechnicImplementationPlan = req.PyrotechnicImplementationPlan
|
||||
PyrotechnicImplementationPlan = req.PyrotechnicImplementationPlan,
|
||||
CityId = a.CityId,
|
||||
City = a.City!.Name,
|
||||
ShowStaffs = a.ShowStaffs,
|
||||
ShowTrucks = a.ShowTrucks,
|
||||
SoundTimecodes = a.SoundTimecodes,
|
||||
ProductTimecodes = a.ProductTimecodes,
|
||||
Contracts = a.Contracts,
|
||||
ShowMaterials = a.ShowMaterials,
|
||||
})
|
||||
.FirstOrDefaultAsync(ct);
|
||||
await Send.OkAsync(show, ct);
|
||||
|
||||
Reference in New Issue
Block a user