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
{{ message }}
This repository was archived by the owner on Aug 18, 2021. It is now read-only.
Liquid provides a LightExpression class that abstracts common LINQ expressions and adds the capability to extend those queries to easily build more complex queries.
The user could build the queries dynamically by adding conditions to original query in a intuitive way.
The LightExpression class can be cast implicitly to a Expression<Func<T, bool>>
public async Task<DomainResponse> SearchCities(CityViewModel filter)
{
var query = LightExpression<CityModel>.New();
if (filter.Name != null)
{
query = query.Where(x => x.Name == filter.Name);
}
if (filter.Country != null)
{
query = query.Where(x => x.Country == filter.Country);
}
var result = await Repository.GetAsync<CityModel>(query);
return Response(result);
}