Say I have the following:
namespace SomeProject
{
public interface ISomething
{
string SomeMethod();
}
}
namespace SomeService
{
[DataContract]
public class CompositeType
{
[DataMember]
public ISomething Something { get; set; }
}
}
Now, in my calling code I want to be able to do this:
SomeService service = new SomeService();
service.Something.SomeMethod();
SomeMethod()
is not available unless I return the DataMember as the implementation rather than the interface. Is there a way to do this?