Commit 6bc5e607 authored by Andres Käver's avatar Andres Käver
Browse files

get track by id

parent a4e8d95b
Pipeline #843 passed with stages
in 2 minutes and 39 seconds
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
......@@ -34,5 +35,20 @@ namespace DAL.App.EF.Repositories
return result;
}
public override async Task<Track> FirstOrDefaultAsync(Guid id, object? userId = null, bool noTracking = true)
{
var query = PrepareQuery(userId, noTracking);
query = query
.Include(l => l.Name)
.ThenInclude(t => t!.Translations)
.Include(l => l.Description)
.ThenInclude(t => t!.Translations);
var domainEntity = await query.FirstOrDefaultAsync(e => e.Id.Equals(id));
var result = Mapper.Map(domainEntity);
return result;
}
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment