Is this how you get to my abstract class properties?
public interface IMyObj(
void myMethod();
)
public abstract class MyObjBase
(
public string myProperty{get; set;}
)
public class myObj : MyObjBase, IMyObj
(
)
public void SomeMethod(IMyObj myobj)
{
// is there another way to do this, seems awkward
(myobj as myobjBase).myProperty = "value";
}
The type of your parameter needs to be of type “myObj” (as the class implements both interface and abstract class) if you want to access both interface and abstract class members. Your intellisense rightfully tells you that if you pass in an interface, it expects any derived classes that implement that interface but has no way to determine what other abstract classes or interfaces you are implementing. I would suggest that: