So I'm writing a 'semi-generic' class that fits the same pattern over and over again with the signature
public class BaseSupportRepo<TEntity, TDto> where TEntity : class where TDto : class
All of the repos that use this class have one property which is Name
What I want to do is write a function that will return a .Single() if a name matches some input (however name is not a primary key).
Now if this was a non generic function it'd be easy since
.Single(g => g.Name == name)
However because this is a generic function the .Name property cannot be used since TEntity may not have any property Name.
Is there any function in EF that can allow something akin to :-
.Single(string key, string value)
This would allow me to get around this requirement.