当我尝试为接收消息操作添加自定义类型时,我不断收到此错误:
"Cannot implicitly convert type 'object' to 'type.x.' An explicit conversion exists.
这是我的对象:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace TestWorkflowService
{
public abstract class Duck
{
public string Name { get; set; }
public string Type { get; set; }
public Duck(string name,string type)
{
this.Name = name;
this.Type = type;
}
public virtual string Quack()
{
return "Quack Quack!";
}
}
public class Mallard : Duck
{
public Mallard(string name)
: base(name, "Mallard")
{
}
}
public class RubberDuck : Duck
{
public RubberDuck(string name)
:base(name, "Rubber Duck")
{
}
public override string Quack()
{
return "Squeek Squeek";
}
}
}