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
[ClientMetadata("email")] | |
public class EmailSender : ISender | |
{ | |
public Task Send(string message) | |
{ | |
// Sending message to client | |
return Task.CompletedTask; | |
} | |
} |
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
builder.Register<SenderFactory>(c => | |
{ | |
var context = c.Resolve<IComponentContext>(); | |
return (client) => | |
{ | |
var sender = context.Resolve<IEnumerable<ISender>>() | |
.Select(s => new | |
{ | |
Metadata = (ClientMetadataAttribute) Attribute.GetCustomAttribute(s.GetType(), |
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
[Route("api/[controller]")] | |
[ApiController] | |
public class TestController : ControllerBase | |
{ | |
private readonly SenderFactory _senderFactory; | |
public TestController(SenderFactory senderFactory) | |
{ | |
_senderFactory = senderFactory; | |
} |
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
builder.Register<SenderFactory>(c => | |
{ | |
var context = c.Resolve<IComponentContext>(); | |
return (client) => | |
{ | |
var sender = context.Resolve<IEnumerable<Meta<ISender>>>() | |
.First(x => (string) x.Metadata["Client"] == client).Value; | |
return sender; |
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
builder.Register<SenderFactory>(c => | |
{ | |
var context = c.Resolve<IComponentContext>(); | |
return (client) => | |
{ | |
var sender = context.Resolve<IEnumerable<Meta<ISender>>>() | |
.First(x => (string) x.Metadata["Client"] == client).Value; | |
return sender; |
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 ApplicationModule : Module | |
{ | |
protected override void Load(ContainerBuilder builder) | |
{ | |
builder | |
.RegisterModule<AttributedMetadataModule>(); | |
builder.Register<SenderFactory>(c => | |
{ | |
var context = c.Resolve<IComponentContext>(); |
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 delegate ISender SenderFactory(string client); |
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
[HttpGet()] | |
public async Task<IActionResult> SendMessage(string senderType) | |
{ | |
return Ok(); | |
} |
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
1>------ Rebuild All started: Project: Utils, Configuration: Debug Any CPU ------ | |
2>------ Rebuild All started: Project: Validation, Configuration: Debug Any CPU ------ | |
1>CQRS\GenericUpdateDeleteQuery.cs(12,31,12,38): warning CS0649: Field 'GenericUpdateDeleteQuery<TResult, TPayload>._userId' is never assigned to, and will always have its default value | |
1>Utils -> D:\VSI\VsiManagerCore\Shared\Infrastructure\Utils\bin\Debug\netcoreapp3.1\Utils.dll | |
1>Done building project "Utils.csproj". | |
3>------ Rebuild All started: Project: UploadCommunicationModule, Configuration: Debug Any CPU ------ | |
4>------ Rebuild All started: Project: PatientCommunicationModule, Configuration: Debug Any CPU ------ | |
2>BaselineValidator.cs(23,30,23,33): warning CS0168: The variable 'err' is declared but never used | |
2>BaselineValidator.cs(37,30,37,33): warning CS0168: The variable 'err' is declared but never used | |
2>Validation -> D:\VSI\VsiManagerCore\Shared\Infrastructure\Validation\bin\Debug\netcoreapp3.1\Validation.dll |
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 System; | |
using System.Collections.Generic; | |
using System.Net; | |
using System.Net.Sockets; | |
using System.Text; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace Hl7v2MLLP | |
{ |
NewerOlder