diff --git a/Lieb/Data/RaidTemplateService.cs b/Lieb/Data/RaidTemplateService.cs index 552345d..7e2c7c5 100644 --- a/Lieb/Data/RaidTemplateService.cs +++ b/Lieb/Data/RaidTemplateService.cs @@ -7,10 +7,12 @@ namespace Lieb.Data { private readonly IDbContextFactory _contextFactory; + private readonly RaidService _raidSerive; - public RaidTemplateService(IDbContextFactory contextFactory) + public RaidTemplateService(IDbContextFactory contextFactory, RaidService raidSerice) { _contextFactory = contextFactory; + _raidSerive = raidSerice; } public List GetTemplates() @@ -86,7 +88,7 @@ namespace Lieb.Data return; } Raid raid = new Raid(template); - context.Raids.Add(raid); + await _raidSerive.AddOrEditRaid(raid, null, null, null, template.RaidOwnerId); MoveTemplate(template); await context.SaveChangesAsync(); }