This file contains 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
// Compile this code using: csc ipctest.cs /r:Zyan.Communication.dll | |
// First run — starts server. | |
// Second run — starts client. | |
using System; | |
using System.Linq; | |
using System.Text; | |
using Zyan.Communication; | |
using Zyan.Communication.Protocols.Ipc; |
This file contains 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 Microsoft.AspNetCore.Mvc.ViewEngines; | |
using Microsoft.Extensions.DependencyInjection; | |
namespace Microsoft.AspNetCore.Mvc | |
{ | |
/// <summary> | |
/// Controller extensions | |
/// </summary> | |
public static class ControllerExtensions | |
{ |
This file contains 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 GenericHandlersModule : Module | |
{ | |
protected override void Load(ContainerBuilder builder) | |
{ | |
builder.RegisterType<CreateCommandHandler<Foo, CreateFooCommand>>().As<IRequestHandler<CreateFooCommand, bool>>(); | |
builder.RegisterType<DeleteCommandHandler<Foo, DeleteFooCommand>>().As<IRequestHandler<DeleteFooCommand, bool>>(); | |
builder.RegisterType<ListQueryHandler<Foo, ListFooQuery>>().As<IRequestHandler<ListFooQuery, IEnumerable<Foo>>>(); | |
builder.RegisterType<UpdateCommandHandler<Foo, UpdateFooCommand>>().As<IRequestHandler<UpdateFooCommand, bool>>(); | |
} | |
} |