This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static class WaitUtils | |
| { | |
| /// <summary> | |
| /// Wait until some action is done or until timeout is reached. | |
| /// <code> | |
| /// var waitResult = await WaitUtils.WaitUntilAsync( | |
| /// async () => | |
| /// { | |
| /// // some actions | |
| /// var result = await db.FirstOrDefault(q=> q.Status == Status.Success); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /db | |
| /plugins | |
| /uploads | |
| /logs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # PowerShell script that recursively deletes all 'bin' and 'obj' (or any other specified) folders inside current folder | |
| $CurrentPath = (Get-Location -PSProvider FileSystem).ProviderPath | |
| # recursively get all folders matching given includes, except ignored folders | |
| $FoldersToRemove = Get-ChildItem .\ -include bin,obj -Recurse | where {$_ -notmatch '_tools' -and $_ -notmatch '_build'} | foreach {$_.fullname} | |
| # recursively get all folders matching given includes | |
| $AllFolders = Get-ChildItem .\ -include bin,obj -Recurse | foreach {$_.fullname} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: "3" | |
| services: | |
| sonarqube: | |
| image: sonarqube | |
| expose: | |
| - 9000 | |
| ports: | |
| - "127.0.0.1:9000:9000" | |
| networks: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static partial class LinqExtensions | |
| { | |
| public static Maybe<C> SelectMany<A, B, C>(this Maybe<A> ma, Func<A, Maybe<B>> f, Func<A, B, C> select) => ma.Bind(a => f(a).Map(b => select(a, b))); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Startup | |
| { | |
| // ... | |
| public void ConfigureServices(IServiceCollection services) | |
| { | |
| // ... | |
| services.AddScoped<NotificationContext>(); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static class ProblemDetailsExtensions | |
| { | |
| public static IServiceCollection ConfigureProblemDetailsModelState(this IServiceCollection services) | |
| { | |
| return services.Configure<ApiBehaviorOptions>(options => | |
| { | |
| options.InvalidModelStateResponseFactory = context => | |
| { | |
| var problemDetails = new ValidationProblemDetails(context.ModelState) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static class ProblemDetailsExtensions | |
| { | |
| public static void UseProblemDetailsExceptionHandler(this IApplicationBuilder app, ILoggerFactory loggerFactory) | |
| { | |
| app.UseExceptionHandler(builder => | |
| { | |
| builder.Run(async context => | |
| { | |
| var exceptionHandlerFeature = context.Features.Get<IExceptionHandlerFeature>(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class NotificationFilter : IAsyncResultFilter | |
| { | |
| private readonly NotificationContext _notificationContext; | |
| public NotificationFilter(NotificationContext notificationContext) | |
| { | |
| _notificationContext = notificationContext; | |
| } | |
| public async Task OnResultExecutionAsync(ResultExecutingContext context, ResultExecutionDelegate next) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [Route("api/[controller]")] | |
| [ApiController] | |
| public class CustomersController : ControllerBase | |
| { | |
| private readonly IMediator _mediator; | |
| public CustomersController(IMediator mediator) | |
| { | |
| _mediator = mediator; | |
| } |
NewerOlder