✅ what should I do to use derived class for return type?
I have following:
is it possible to return this?
public abstract class CommandResult
{
public string Error { get; set; }
}
public abstract class CommandResult2 : CommandResult
{
public string Error { get; set; }
public string Data { get; set; }
}
public abstract class SolverManagerPureCommand<TArgument>
{
protected abstract Task<CommandResult> ExecuteInternalCoreAsync(TArgument argument);
}
public sealed class BuildDataSetCommand : SolverManagerPureCommand<string>
{
protected override Task<CommandResult> ExecuteInternalCoreAsync(string argument)
{
throw new NotImplementedException();
}
}
public abstract class CommandResult
{
public string Error { get; set; }
}
public abstract class CommandResult2 : CommandResult
{
public string Error { get; set; }
public string Data { get; set; }
}
public abstract class SolverManagerPureCommand<TArgument>
{
protected abstract Task<CommandResult> ExecuteInternalCoreAsync(TArgument argument);
}
public sealed class BuildDataSetCommand : SolverManagerPureCommand<string>
{
protected override Task<CommandResult> ExecuteInternalCoreAsync(string argument)
{
throw new NotImplementedException();
}
}
protected override Task<CommandResult2> ExecuteInternalCoreAsync(string argument)
protected override Task<CommandResult2> ExecuteInternalCoreAsync(string argument)
0 Replies