You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When there are multiple query conditions at the same time and do not know whether each query condition has a value, we must first determine whether the condition is empty, and then determine whether to add it to the filter condition, using Where is more troublesome, whether Provide a WhereIf extension similar to Abp, that is very convenient, this is just a request for optimization, thank you.
db.Employee
.WhereIf<Employee>(!string.IsNullOrEmpty(query.key), n => n.Name == query.key || n.Description.Contains(query.key)).ToList();