c# - Inheriting from an interface with properties of the same name -
i have interface iproduct , 2 partial classes searchedproductinternal , searchedproductexternal. these 2 classes extending classes coming 3rd party webservice searches both return different result types. want use interface both type returned same. know how inherit do return "name" both interface , searchedproductinternal have same object name?
my interface similar follows:
public interface iproduct { string name { get; } string id { get; } string descriptionshort { get; } string descriptionlong { get; } }
my object searchedproductinternal has following properties:
string name; int objectidfield; string descriptionshortfield; string descriptionlongfield;
so inheriting
public partial class searchedproductinternal : iproduct { public string id { { return objectidfield.tostring(); } } public string name { //what do here? } public string descriptionshort{get { return shortdescriptionfield; } } public string descriptionlong {get { return longdescriptionfield; } } }
i want return name has been originality assigned in searchedproductinternal class don't know how because if put
return name
i stackoverflow error appears keeping calling self?
i think should here explicitly implement interface, have both name property defined in class , iproduct.name property interface.
Comments
Post a Comment