jeudi 4 octobre 2018

Alternative Answer to how to get C# lambda expression member name and value

I have looked for an answer to my question I found many but involved sending the parent object as a second param and such

In my case I wanted to convert:

    private static bool ValidateParam(object param, string paramName)
    {
        if (param == null)
            throw new ParameterCannotBeNullException(paramName);

        return true;
    }

into something that doesn't require me to manually call it by typing the name ValidateParam(request.Bla, "bla");





Aucun commentaire:

Enregistrer un commentaire