/// <summary> /// <inheritdoc /> /// </summary> /// <param name="ctx"></param> /// <param name="entry"></param> public void Log([FromServices] InfTestContext ctx, LogEntry entry) { if (ctx != null && entry != null) { bool hasEntry = ctx.LogEntries.Any(a => a.Id == entry.Id); if (!hasEntry) { ctx.LogEntries.Add(entry); ctx.SaveChanges(); } ; } ; }
public InfController(InfTestContext context, IInfLoggerService loggerService) { ctx = context; logger = loggerService; }