dimanche 26 juillet 2015

Get property-name of generic abstract class

Considering the following implementation of a generic, abstract class:

public abstract class BaseRequest<TGeneric> : BaseResponse where TRequest : IRequestFromResponse
{
    public TGeneric Request { get; set; }
}

Is there any chance to get the name of the property Request without having an instance inherited from it?

I need Request as string "Request" to avoid using hardcoded strings. Any ideas how to make this through reflection?





Aucun commentaire:

Enregistrer un commentaire