I have a base class that has a bool property which looks like this:
public abstract class MyBaseClass
{
public bool InProgress { get; protected set; }
}
I am inheriting it another class from it and trying to add InProgress as a delegate to the dictionary. But it throws me an error. This is how my Derived class looks like:
public abstract class MyClass
{
Dictionary<string, object> dict = new Dictionary<string, object>();
dict.Add("InProgress", InProgress => base.InProgress = InProgress);
}
This is the error I am getting:
Cannot convert lambda expression to type 'object' because it is not a delegate type
What am I doing wrong here?
object
. Which delegate type did you want to convert it to, and how did you expect the compiler to know that? – Huebner