You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I added Notifications at first, but it didn't work, then I changed to Request, and finally got the error message: "One or more errors occurred. (No service for type 'MediatR.IRequestHandler`1"
Below is all my code, what am I missing? Thanks for any help
public class DeviceInfoUpdate : IRequest
{
}
public class DeviceInfoSyncRegional : IRequestHandler<DeviceInfoUpdate>
{
public Task Handle(DeviceInfoUpdate notification, CancellationToken cancellationToken) {
Console.WriteLine("ok...");
return Task.CompletedTask;
}
}
//send
_mediator.Send(new DeviceInfoUpdate()).Wait();
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I added the code according to the example in the wiki:
I added Notifications at first, but it didn't work, then I changed to Request, and finally got the error message: "One or more errors occurred. (No service for type 'MediatR.IRequestHandler`1"
Below is all my code, what am I missing? Thanks for any help
Beta Was this translation helpful? Give feedback.
All reactions