Please consider this code:
public interface ImyInterface
{
T GetEntity<T>(T t,int MasterID);
}
I declare a class name : MyEntity
and it has a property with name A_1
public class BL_Temp : ImyInterface
{
public MyEntity GetEntity<MyEntity>(MyEntity t, int MasterID)
{
t.A_1 = ""; //Error
return t;
}
}
the error is :
'MyEntity' does not contain a definition for 'A_1' and no extension method 'A_1' accepting a first argument of type 'MyEntity' could be found (are you missing a using directive or an assembly reference?)
Does it possible to declare a generic method in non generic interface?
where is my mistakes?
thanks
Edit1)
Consider MyEntity
declaration is :
public class MyEntity
{
public string A_1 {set; get;}
}