jeudi 2 août 2018

Get Member Name from Type class constructor

Is it possible to get the Name from the type member from the type's constructor? For Example :

Class containing member property

public class ClassA
{
    public int X {get; set; }
    public GenericType<ClassA> iNeedThisName {get; set;}
}

Class definition for GenericType from where I'd wish to access the value from the constructor

public class GenericType<T>
{
    private _iNeedThisNameValue = null;
    public GenericType()
    {
        _iNeedThisNameValue = this.Get"IneedThisName()".ExtensionMethod();
    }
    public string idLikeToDefault { get; set;} = _iNeedThisNameValue;
}





Aucun commentaire:

Enregistrer un commentaire