public frmMain(IServiceActor serviceActor, IServiceFilm serviceFilm, IServiceDirector serviceDirector, IServiceFilmType serviceFilmType, IServiceProducer serviceProducer, IServiceUser serviceUser, IServiceWriter serviceWriter) { _serviceActor = serviceActor; _serviceFilm = serviceFilm; _serviceDirector = serviceDirector; _serviceFilmType = serviceFilmType; _serviceProducer = serviceProducer; _serviceUser = serviceUser; _serviceWriter = serviceWriter; InitializeComponent(); }
protected override Task ExecuteAsync(CancellationToken stoppingToken) { var conf = new ConsumerConfig { GroupId = "Films-consumer", BootstrapServers = "host.docker.internal:9094", AutoOffsetReset = AutoOffsetReset.Earliest }; using (var c = new ConsumerBuilder <Ignore, string>(conf).Build()) { c.Subscribe("films"); var cts = new CancellationTokenSource(); try { while (true) { var message = c.Consume(cts.Token); Films F = new Films(); var serializeOptions = new JsonSerializerOptions { PropertyNamingPolicy = JsonNamingPolicy.CamelCase }; F = JsonSerializer.Deserialize <Films>(message.Value, serializeOptions); using (var scope = _serviceScopeFactory.CreateScope()) { service = scope.ServiceProvider.GetService <IServiceFilm>(); service.Create(F); } } } catch (OperationCanceledException) { c.Close(); } } return(Task.CompletedTask); }
public FilmController(IServiceFilm serviceFilm,IServiceActor serviceActor) { _serviceFilm = serviceFilm; _serviceActor = serviceActor; }
public FilmController(IServiceFilm serviceFilm) { _iServiceFilm = serviceFilm; }
public FilmController(IServiceFilm serviceFilm, IServiceActor serviceActor) { _serviceFilm = serviceFilm; _serviceActor = serviceActor; }
public FilmController(IServiceFilm serviceFilm) { _serviceFilm = serviceFilm; }
public ControllerFilm(IServiceFilm _service) { this.service = _service; }