-
-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to cast Object of type(...) to ICommandHandler #46
Comments
Can you share your HelloWorldCommandHandler and HelloWorldCommand implementations? |
Hello James, thanks for the quick response! Below are the sample files. The following is in a netstandard2.0 library named "ThreeWill.Functions.Commands" using System;
using AzureFromTheTrenches.Commanding.Abstractions;
namespace ThreeWill.Functions.Commands
{
public class HelloWorldCommand : ICommand<string>
{
public string Name { get; set; }
}
} The following is in a netstandard2.0 library named "ThreeWill.Functions.Application" using System;
using System.Text;
using System.Collections.Generic;
using System.Threading.Tasks;
using AzureFromTheTrenches.Commanding.Abstractions;
using ThreeWill.Functions.Commands;
namespace ThreeWill.Functions.Application.Handlers
{
internal class HelloWorldCommandHandler : ICommandHandler<HelloWorldCommand>
{
public Task ExecuteAsync(HelloWorldCommand command)
{
throw new NotImplementedException();
}
}
} I can also share the entire solution if you'd like. Nothing in there of any import yet. Let me know. Very interested to get FunctionMonkey working - Thanks for creating it! |
@JamesRandall, I created a private repo and added you as a collaborator to the project. Likely something simple on my part is missing. :-) |
Thanks for that. The line:
needs to read
Your ExecuteAsync method signature will then become:
If your command returns a result the command handler needs that as part of its generic type definition. Hope that helps! Will leave this issue open for the moment in case not! |
Thanks James, I knew it was likely something simple! Sorry for the bother but very much appreciate the response and patience! Works perfectly! |
No problem at all. I moved Function Monkey to v1.0.0 since I recorded the first 2 videos and there were a couple of breaking changes - in case you run into any issues there is a very short doc here that describes them and how to resolve them: https://functionmonkey.azurefromthetrenches.com/guides/upgradingTo1.0.html I also cover them in part 3 which I should be publishing later today. |
Following your recent Part 1 video on using FunctionMonkey and once I have a simple structure created to verify the plumbing works, I get the following error:
The text was updated successfully, but these errors were encountered: