I have a Web API project that uses Entity Framework. I have an action api/account that given an ID returns that account.
There is an additional parameter that can be provided which is what fields to be returned e.g. api/account?field=name
I'm trying to work out the best way of translating from this string input to Entity Framework. I know I can use .Select() to only get certain columns but that takes in a Func and the only way I can think of getting from the string to a Func is by using Reflection. This seems like it will be a peformance hit if I have to do Reflection for every property passed in, is there a better way of doing this?
Thanks