public void RemoveResolution(ResolutionExchange exchange) { this._resolutions.Add(exchange); using var scope = _scopeFactory.CreateScope(); using var service = scope.ServiceProvider.GetRequiredService <ResolutionService>(); service.RemoveResolution(exchange.Resolution); }
public ResolutionExchange CreateResolution(string committeeId, int?roleId = null) { using var scope = _scopeFactory.CreateScope(); using var service = scope.ServiceProvider.GetRequiredService <ResolutionService>(); var resolution = service.CreateResolutionForCommittee(committeeId, roleId); var exchange = new ResolutionExchange(_scopeFactory) { Resolution = resolution, }; _resolutions.Add(exchange); var args = new ResolutionExchangeUpdatedEventArgs() { CommitteeId = committeeId, ResolutionId = resolution.ResaElementId, Topic = resolution.Topic, }; ResolutionExchangeUpdated?.Invoke(this, args); return(exchange); }
public ResolutionExchange GetResolution(string resolutionId) { var exchange = _resolutions.FirstOrDefault(n => n.Resolution.ResaElementId == resolutionId); if (exchange == null) { using var scope = _scopeFactory.CreateScope(); using var service = scope.ServiceProvider.GetRequiredService <ResolutionService>(); var resolution = service.GetResolution(resolutionId); if (resolution == null) { // Resolution not found! return(null); } else { exchange = new ResolutionExchange(_scopeFactory); exchange.Resolution = resolution; _resolutions.Add(exchange); } } return(exchange); }