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
| using x.Infrastructure.MassTransit; | |
| using MassTransit; | |
| using MassTransit.Scheduling; | |
| namespace x.Infrastructure; | |
| public static class MasstransitSchedulerExtensions | |
| { | |
| public static IMessageScheduler CreateCustomMessageScheduler(this IBus bus, Guid id) | |
| { |
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
| using System; | |
| using static Domain.Result; | |
| namespace Domain | |
| { | |
| public readonly struct Result | |
| { | |
| private readonly Result<int, StringError> _result => new Result<int, StringError>(0); | |
| public int Value => _result.Value; |
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 readonly struct ReadOnlyElement | |
| { | |
| private readonly ReadOnlySpan<byte> LessThanSign => new[] {(byte) '<'}; | |
| private readonly ReadOnlySpan<byte> GreaterThanSign => new[] {(byte) '>'}; | |
| private readonly ReadOnlySpan<byte> CloseElementSign => new[] {(byte) '<', (byte) '/'}; | |
| private readonly ReadOnlySpan<byte> EqualSign => new[] {(byte) '='}; | |
| private readonly ReadOnlySpan<byte> DoubleQuote => new[] {(byte) '\"'}; | |
| private readonly ReadOnlySpan<byte> WhiteSpace => new[] {(byte) ' '}; |
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
| class Program | |
| { | |
| private static IPEndPoint IPEndPoint = new IPEndPoint(IPAddress.Loopback, 8801); | |
| private static TcpClient Client = new TcpClient(IPEndPoint); | |
| static async Task Main(string[] args) | |
| { | |
| Console.WriteLine($"Started on {IPEndPoint}"); |
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
| using System; | |
| using System.Collections.Generic; | |
| using System.Threading.Tasks; | |
| namespace Interlocked | |
| { | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { |
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.AddMvc(); | |
| services.AddIdentity<IdentityUser<int>, IdentityRole<int>>() | |
| .AddUserStore<CustomUserStore>(); | |
| } | |
| } |
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 CustomUserStore : IUserStore<IdentityUser<int>> | |
| { | |
| private readonly List<IdentityUser<int>> _users; | |
| public CustomUserStore() | |
| { | |
| _users = new List<IdentityUser<int>>(); | |
| } | |
| public Task<IdentityResult> CreateAsync(IdentityUser<int> user, CancellationToken cancellationToken) |
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.AddMvc(); | |
| services.AddIdentity<IdentityUser<int>, IdentityRole<int>>() | |
| .AddEntityFrameworkStores<ApplicationDbContext>(); | |
| } | |
| } |
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 CustomFromQueryAttribute : FromQueryAttribute | |
| { | |
| public CustomFromQuery(string name) | |
| { | |
| Name = name.ToSnakeCase(); | |
| } | |
| } |
NewerOlder