Standard escape codes are prefixed with Escape:
- Ctrl-Key:
^[ - Octal:
\033 - Unicode:
\u001b - Hexadecimal:
\x1B - Decimal:
27
| var bld = WebApplication.CreateBuilder(); | |
| bld.Services | |
| .AddFastEndpoints() | |
| .SwaggerDocument(o => | |
| { | |
| o.DocumentSettings = s => | |
| { | |
| s.DocumentName = "Initial Release"; | |
| s.Version = "v0"; | |
| }; |
| [ | |
| JsonPolymorphic(TypeDiscriminatorPropertyName = "_t"), | |
| JsonDerivedType(typeof(MultiChoiceQuestionRequest), "mcq"), | |
| JsonDerivedType(typeof(RatingQuestionRequest), "rq") | |
| ] | |
| public class BaseQuestionRequest | |
| { | |
| public int Id { get; set; } | |
| } |
| public class BaseRequest | |
| { | |
| public string? Id { get; init; } | |
| } | |
| public class BaseRequestValidator : Validator<BaseRequest> | |
| { | |
| public BaseRequestValidator() | |
| { | |
| RuleFor(x => x.Id) |
| [HttpGet("publish"), AllowAnonymous] | |
| sealed class MyEndpoint : EndpointWithoutRequest | |
| { | |
| public override async Task HandleAsync(CancellationToken c) | |
| { | |
| var evnt = new MyEvent { Message = "hello!" }; | |
| await PublishAsync(evnt); | |
| await SendAsync("all good!"); | |
| } | |
| } |
| sealed class MyRequest | |
| { | |
| public int Id { get; set; } | |
| } | |
| public sealed class MyCommand : ICommand<int> | |
| { | |
| public string Identity { get; set; } | |
| } |
| using Testcontainers.MongoDb; | |
| public class Sut : AppFixture<Program> | |
| { | |
| const string Database = "TestingDB"; | |
| const string RootUsername = "root"; | |
| const string RootPassword = "password"; | |
| MongoDbContainer _container = null!; |
| app.UseSwaggerGen( | |
| s => | |
| { | |
| //where to serve swagger.json files from | |
| s.Path = "/PREFIX/swagger/{documentName}/swagger.json"; | |
| //api endpoint server base path customization | |
| s.PostProcess = (document, request) => | |
| { | |
| document.Servers.Clear(); |
| internal sealed class AddCustomHeader : IOperationProcessor | |
| { | |
| public bool Process(OperationProcessorContext context) | |
| { | |
| var hdrParameter = new OpenApiParameter() | |
| { | |
| Name = "x-custom", | |
| Kind = OpenApiParameterKind.Header, | |
| IsRequired = true, | |
| Type = JsonObjectType.String, |
| using FastEndpoints; | |
| using MessagePack; | |
| using Microsoft.EntityFrameworkCore; | |
| using Microsoft.EntityFrameworkCore.Storage.ValueConversion; | |
| public class JobRecord : IJobStorageRecord | |
| { | |
| public Guid Id { get; set; } | |
| public string QueueID { get; set; } | |
| public object Command { get; set; } |