Todos Novo

user:thomas gists created by user

title:mygist gists with given title

filename:myfile.txt gists having files with given name

extension:yml gists having files with given extension

language:go gists having files with given language

topic:homelab gists with given topic

Registrar-se

Entrar


Todos Novo Registrar-se Entrar

Todos os gists

Mais recente criado
Menos recente criado
Mais recente atualizado
Menos recente atualizado
twerner's Avatar

twerner / ASP.NET Core Rate Limiting

0 curtidas
0 bifurcações
2 arquivos
Última atividade 1 year ago
1 // Existing services ...
2
3 builder.Services.AddRateLimiter(options =>
4 {
5 options.GlobalLimiter = PartitionedRateLimiter.Create<HttpContext, string>(httpContext =>
6 RateLimitPartition.GetFixedWindowLimiter(
7 partitionKey: httpContext.User.Identity?.Name ?? httpContext.Request.Headers.Host.ToString(),
8 factory: partition => new FixedWindowRateLimiterOptions
9 {
10 AutoReplenishment = true,
twerner's Avatar

twerner / GenericRepository

0 curtidas
0 bifurcações
6 arquivos
Última atividade 1 year ago
1 public class GenericRepository<T, TKey> : IGenericRepository<T, TKey>
2 where T : class
3 where TKey : IEquatable<TKey>
4 {
5 protected readonly ApplicationDbContext Context;
6 protected readonly IMapper Mapper;
7
8 protected GenericRepository(ApplicationDbContext context, IMapper mapper)
9 {
10 Context = context;
Próximo Anterior

Desenvolvido por Opengist ⋅ Load: 29ms⋅

Português
Čeština Deutsch English Español Français Magyar Italiano 日本語 Polski Português Русский Türkçe Українська 中文 繁體中文