Skip to content

Instantly share code, notes, and snippets.

@jonhilt
Created October 14, 2021 08:06
Show Gist options
  • Save jonhilt/106a97d99b01c9e112c51f3ed68d9c88 to your computer and use it in GitHub Desktop.
Save jonhilt/106a97d99b01c9e112c51f3ed68d9c88 to your computer and use it in GitHub Desktop.
namespace MessagingTestApp.Features.Mesgs
{
public class List
{
public class Query : IRequest<Model>
{
}
public class Model
{
public List<string> Mesgs { get; set; }
}
// add this nested class...
public class QueryHandler : IRequestHandler<Query, Model>
{
public async Task<Model> Handle(Query request, CancellationToken cancellationToken)
{
return new Model
{
Mesgs = new List<string>
{
"One from the server",
"Two from the server",
"Three from the server",
"Four"
}
};
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment