public Employee(IAppLogger <Employee> logger) { _logger = logger; _logger.Info("Employee instantiated..."); }
public HomeController(ISendingMicroApp sendingApp, IAppLogger logger) { this.sendingApp = sendingApp; _logger = logger; }
public UserService(UserManager <ApplicationUser> userManager, IAsyncRepository <User> userRepository, IAppLogger <TeamService> logger) { _userManager = userManager; _userRepository = userRepository; _logger = logger; }
public LoginWith2faModel(SignInManager <ApplicationUser> signInManager, IAppLogger <LoginWith2faModel> logger) { _signInManager = signInManager; _logger = logger; }
public EmbyService(IAppLogger logger, IEmbyClient client, IEmbyRepository embyRepository) : base(logger, client, embyRepository) { }
/// <summary> /// 构造方法。 /// </summary> /// <param name="instrument">处理合约。</param> /// <param name="publisher">发布者。</param> /// <param name="tradeRange">交易时段。</param> public KLineFactory(USeInstrument instrument, IKLinePublisher publisher, DayTradeRange tradeRange, IAppLogger eventLogger) { m_instrument = instrument; m_publisher = publisher; m_tradeRange = tradeRange; m_eventLogger = eventLogger; }
public CategoryService(IAppLogger <CategoryService> logger, ICategoryRepo categoryRepo) { _categoryRepo = categoryRepo; _logger = logger; }
public ProductService(IProductRepository productRepository, IAppLogger <ProductService> logger) { _productRepository = productRepository ?? throw new ArgumentNullException(nameof(productRepository)); _logger = logger ?? throw new ArgumentNullException(nameof(logger)); }
public Worker(IServiceScopeFactory serviceScopeFactory, EventsFactory eventsFactory, IAppLogger <ExceptionHandler> exeptionHandlerLogger) { _eventsFactory = eventsFactory; _serviceScopeFactory = serviceScopeFactory ?? throw new ArgumentNullException(nameof(serviceScopeFactory)); _exceptionHandler = new ExceptionHandler(eventsFactory, exeptionHandlerLogger); }
public TokenController(IAppLogger <TokenController> appLogger, IUserService userService) : base(appLogger) { _userService = userService; }
public ChannelService(IAsyncRepository <Channel> channelRepository, IAppLogger <ChannelService> logger) { _channelRepository = channelRepository; _logger = logger; }
public LocalScanAppLogger(IAppLogger parent, string baseFileName) : base(parent, baseFileName) { HandBrakeUtils.MessageLogged += this.OnMessageLoggedLocal; HandBrakeUtils.ErrorLogged += this.OnErrorLoggedLocal; }
public PersonApplication(IPersonRepository personRepository, IMapper mapper, IAppLogger <PersonApplication> logger) { _personRepository = personRepository; _mapper = mapper; _logger = logger; }
public EditModel(MyRepository <Negocio> repository, MyRepository <Categoria> categoriaRepository, IAppLogger <EditModel> logger, INotyfService notifyService) { _repository = repository; _categoriaRepository = categoriaRepository; _logger = logger; _notifyService = notifyService; }
public LoggingBehaviour(IAppLogger AAppLogger) => FAppLogger = AAppLogger;
public static async void LoadInitialSettingsFromJsonFile(AppDbContext ctx, IAppLogger log, string jsonDataFile, LedgerOptions options) { // validate inputs if (ctx == null) { throw new ArgumentNullException(nameof(AppDbContext)); } if (string.IsNullOrWhiteSpace(jsonDataFile)) { throw new ArgumentNullException(nameof(jsonDataFile)); } if (!File.Exists(jsonDataFile)) { throw new FileNotFoundException(nameof(jsonDataFile), jsonDataFile); } // import data into db, get public and private key // add ourselves as first in list await ctx.Hosts.AddAsync(new Host() { Addr = options.Addr, Port = options.Port, LastSeenDT = DateTime.Now }); using (var file = File.OpenText(jsonDataFile)) { var serializer = new JsonSerializer(); var settings = (HostSettings)serializer.Deserialize(file, typeof(HostSettings)); foreach (var host in settings.Hosts) { await ctx.Hosts.AddAsync(host); } } await ctx.SaveChangesAsync(); await log.InfoAsync( "startup - Keys", $"Public: {Program.PublicKey} Private: {Program.PrivateKey}" ); await log.InfoAsync( "startup - import hosts", JsonConvert.SerializeObject(await ctx.Hosts.ToListAsync(), Formatting.None) ); // generate GENESIS block and start to synchronize with others var genesisBlock = new Block(); genesisBlock.ParentBlockId = null; genesisBlock.ChildBlockId = null; // payload genesisBlock.CreatedAt = DateTime.Now; genesisBlock.Originator = options.PublicKey; genesisBlock.Content = "GENESIS BLOCK " + options.Port; // payload signature genesisBlock.Signature = genesisBlock.GetPayloadSignature(Program.PrivateKey); genesisBlock.LocalCreatedAt = genesisBlock.CreatedAt; genesisBlock.BlockId = genesisBlock.GetHash(); await ctx.Blocks.AddAsync(genesisBlock); await ctx.SaveChangesAsync(); await log.InfoAsync( "startup - created GENESIS block", JsonConvert.SerializeObject(await ctx.Blocks.FirstAsync(), Formatting.None) ); }
public PublisherService(IAppLogger <PublisherService> logger, IPublisherRepo publisherRepo) { _publisherRepo = publisherRepo; _logger = logger; }
public Cubes3DIntersectionApiController(ICube3DIntersectionService cube3DIntersectionService, IAppLogger <Cubes3DIntersectionApiController> logger) { _cube3DIntersectionService = cube3DIntersectionService ?? throw new ArgumentNullException(nameof(cube3DIntersectionService)); _logger = logger ?? throw new ArgumentNullException(nameof(logger)); }
public PaymentsJob(ICorrelationIdGenerator correlationIdGenerator, IAppLogger appLogger, IPaymentsProcessor paymentsProcessor) : base(correlationIdGenerator, appLogger) { _paymentsProcessor = paymentsProcessor; }
public static void Write(this IAppLogger logger, string message) { logger.Debug(message); }
public WeekMatchupsDbContext(DbConnection dbConnection, IAppLogger logger) : base(dbConnection, logger) { }
public IndexModel(MyRepository <Paquete> repository, INotyfService notyfService, IAppLogger <UpdateModel> logger) { _repository = repository; _notyfService = notyfService; _logger = logger; }
public ResilencyHandler(IAppLogger appLogger) { this.appLogger = appLogger; }
public InvoicesProcessor(IAppLogger appLogger) { _appLogger = appLogger; }
public CoffeeService(ICoffeeRepository coffeeRepository, IAppLogger <CoffeeService> logger) { _coffeeRepository = coffeeRepository; _logger = logger; CheckArguments(); }
public EmbyImportMovieLogic(IAppLogger logger, ILogicFactory logicFactory) { _logger = logger; _logicFactory = logicFactory; }
public ModelService(IGenericRepository <Model> genericRepository, IAppLogger <ModelService> logger, dbCarRentalContext context) { _genericRepository = genericRepository; _logger = logger; _context = context; }
public WishlistService(IAsyncRepository <Wishlist> wishlistRepository, IAppLogger <WishlistService> logger) { _wishlistRepository = wishlistRepository; _logger = logger; }
public ModelValidationFilter(IAppLogger <ModelValidationFilter> logger) { _logger = logger; }
public LoggingInterceptBehavior(IAppLogger appLogger) { _appLogger = appLogger; }
public async Task InvokeAsync(HttpContext context, AppDbContext dbContext, IAppLogger appLogger) { var response = ""; // log only this endpoint traffic if (context.Request.Path.StartsWithSegments(_endpointPath, StringComparison.Ordinal)) { Console.WriteLine( $"Request for {context.Request.Path} received ({context.Request.ContentLength ?? 0} bytes). Client ip: {context.Connection.RemoteIpAddress}"); await appLogger.DebugAsync("request", $"Request for {context.Request.Path} received ({context.Request.ContentLength ?? 0} bytes). Client ip: {context.Connection.RemoteIpAddress}"); } // p2p responses - who do we know already if (context.Request.Path.StartsWithSegments(_endpointPath + "/addr", StringComparison.Ordinal)) { response = await RequestAddr.Response(dbContext, context); } // p2p responses - ping if (context.Request.Path.StartsWithSegments(_endpointPath + "/ping", StringComparison.Ordinal)) { response = await RequestPing.Response(dbContext, context, _publicKey); } // ledger - get blocks from start to end if (context.Request.Path.StartsWithSegments(_endpointPath + "/blocks", StringComparison.Ordinal)) { response = await RequestBlocks.Response(dbContext, context); } // ledger - merkle root of current ledger if (context.Request.Path.StartsWithSegments(_endpointPath + "/info", StringComparison.Ordinal)) { response = await RequestInfo.Response(dbContext, context); } if (context.Request.Path.StartsWithSegments(_endpointPath + "/singleblock", StringComparison.Ordinal)) { response = await RequestSingleBlock.Response(dbContext, context); } if (context.Request.Path.StartsWithSegments(_endpointPath + "/createblock", StringComparison.Ordinal)) // && context.Request.Method == "POST" { response = await RequestCreateBlock.Response(dbContext, context, _publicKey, _privateKey, _dbLock); } if (context.Request.Path.StartsWithSegments(_endpointPath + "/receiveblock", StringComparison.Ordinal) && context.Request.Method == "POST") { response = await RequestReceiveBlock.Response(dbContext, context, _publicKey, _privateKey, _dbLock); } if (context.Request.Path.StartsWithSegments(_endpointPath + "/receiveledger", StringComparison.Ordinal) && context.Request.Method == "POST") { response = await RequestReceiveLedger.Response(dbContext, context, _publicKey, _privateKey, _dbLock); } // ledger - get one specific block // this has to be final for logging to work correctly if (context.Request.Path.StartsWithSegments(_endpointPath + "/log", StringComparison.Ordinal)) { response = await RequestLog.Response(dbContext); } else if (!string.IsNullOrWhiteSpace(response)) { await appLogger.DebugAsync($"response - {context.Request.Path}", response); } //allow ajax requests from browsers context.Response.Headers.Add("Access-Control-Allow-Origin", "*"); context.Response.Headers.Add("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); if (!string.IsNullOrWhiteSpace(response)) { await context.Response.WriteAsync(response); } // Call the next delegate/middleware in the pipeline if (_next != null) { await _next(context); } /* * if (context.Request.Path.StartsWithSegments(_endpointPath, StringComparison.Ordinal)) * { * await context.Response.WriteAsync("------- After Ledger ------"); * } */ }