Can anyone help me what am i doing wrong with the following c# code? I am basically trying to add the constraint to ICommandHandler.
public interface ICommand<T> where T : BaseDto{ }
public abstract class BaseCommand<T> : ICommand<T> where T : BaseDto { }
public class CreateAlertCommand : BaseCommand<AlertDto>{}
public interface ICommandHandler<TCommand> where TCommand : ICommand{}
I am getting error when defining ICommandHandler. It says 'Using the generic type ICommand<T> requires 1 type argument'
ICommandtype. You have anICommand<T>type. If you want a non-genericICommandtype, you have to create one....Commandclasses represent commands, which are necessarily verbs.