0
當我嘗試添加自定義類型接收消息的動作我不斷收到此錯誤:WF 4.5工作流服務收到消息「不能隱式地將類型'對象'轉換爲'type.x.'顯式轉換存在
"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";
}
}
}