public Handler(IDblDipDbContext context, ITokenProvider tokenProvider, IPasswordHasher passwordHasher, ITokenBuilder tokenBuilder) { _context = context; _tokenProvider = tokenProvider; _passwordHasher = passwordHasher; _tokenBuilder = tokenBuilder; }
public static void Initialize(IDblDipDbContext context, IEventStore store, IConfiguration configuration) { RoleConfiguration.Seed(store); SystemLocationConfiguration.Seed(store, configuration); CardConfiguration.Seed(store, context); UserConfiguration.Seed(context, store); DashboardConfiguration.Seed(context, store); }
public Handler(IDblDipDbContext context) => _context = context;
public EventStoreChangedHandler(IDblDipDbContext context) { _context = context; }
public Handler(IDblDipDbContext context, IDateTime dateTime) { _context = context; _dateTime = dateTime; }
public Handler(IDblDipDbContext context, IHttpContextAccessor httpContextAccessor) { _context = context; _httpContextAccessor = httpContextAccessor; }
public QuoteCreatedSaga(IDblDipDbContext context, IEventStore store) { _context = context; _store = store; }
public static async System.Threading.Tasks.Task <ICollection <DigitalAsset> > Upload(IHttpContextAccessor httpContextAccessor, IDblDipDbContext context, CancellationToken cancellationToken) { var httpContext = httpContextAccessor.HttpContext; var defaultFormOptions = new FormOptions(); var digitalAssets = new List <DigitalAsset>(); if (!MultipartRequestHelper.IsMultipartContentType(httpContext.Request.ContentType)) { throw new Exception($"Expected a multipart request, but got {httpContext.Request.ContentType}"); } var mediaTypeHeaderValue = MediaTypeHeaderValue.Parse(httpContext.Request.ContentType); var boundary = MultipartRequestHelper.GetBoundary( mediaTypeHeaderValue, defaultFormOptions.MultipartBoundaryLengthLimit); var reader = new MultipartReader(boundary, httpContext.Request.Body); var section = await reader.ReadNextSectionAsync(); while (section != null) { var hasContentDispositionHeader = ContentDispositionHeaderValue.TryParse(section.ContentDisposition, out ContentDispositionHeaderValue contentDisposition); if (hasContentDispositionHeader) { if (MultipartRequestHelper.HasFileContentDisposition(contentDisposition)) { using (var targetStream = new MemoryStream()) { await section.Body.CopyToAsync(targetStream, cancellationToken); var name = $"{contentDisposition.FileName}".Trim(new char[] { '"' }).Replace("&", "and"); var bytes = StreamHelper.ReadToEnd(targetStream); var contentType = section.ContentType; var digitalAsset = new DigitalAsset(name, bytes, contentType); context.Add(digitalAsset); digitalAssets.Add(digitalAsset); } } } section = await reader.ReadNextSectionAsync(cancellationToken); } await context.SaveChangesAsync(cancellationToken); return(digitalAssets); }
public Handler(IDblDipDbContext context, ITokenProvider tokenProvider) { _context = context; _tokenProvider = tokenProvider; }
public Handler(IDblDipDbContext context, IEventStore store, ITokenProvider tokenProvider) { _context = context; _tokenProvider = tokenProvider; _store = store; }