I have a method that takes an expression type parameter, in my method I want to get the values โโof this expression, but I canโt find it hot to do this.
private User GetUser(Expression<Func<User, bool>> query) { User user = Context.User.Where(query).FirstOrDefault(); return user; }
I call this method with various parameters, for example
GetUser(u => u.Username == username); GetUser(u=> u.Email == email);
I want to change the GetUser method to work with stored procedures, but I need to find what is inside the request parameter
I want to check if the request is u.Username == username I will call GetUserByUsername SP if the request is u.Email == email I will call GetuserByEmail SP
Yucel source share