LANCommander/LANCommander.Server.Services/PlatformService.cs
2025-02-02 14:58:07 -06:00

24 lines
782 B
C#

using AutoMapper;
using LANCommander.Server.Data;
using LANCommander.Server.Data.Models;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using ZiggyCreatures.Caching.Fusion;
namespace LANCommander.Server.Services
{
public sealed class PlatformService(
ILogger<PlatformService> logger,
IFusionCache cache,
IMapper mapper,
IDbContextFactory<DatabaseContext> contextFactory) : BaseDatabaseService<Platform>(logger, cache, mapper, contextFactory)
{
public override async Task<Platform> UpdateAsync(Platform entity)
{
return await base.UpdateAsync(entity, async context =>
{
await context.UpdateRelationshipAsync(p => p.Games);
});
}
}
}