Есть такой рабочий код:
string tempTitle = filter.Title ?? string.Empty;
string tempAddress = filter.Address ?? string.Empty;
var query = this.db.ShopRepository.Read(m =>
(m.address.Contains(tempAddress))
|| (m.shop_id.Contains(tempTitle))
)
.OrderBy(shop => shop.shop_id)
.ToList();
public virtual IQueryable<T> Read(Expression<Func<T, bool>> expressionWhere)
{
return context.Set<T>().AsNoTracking().Where(expressionWhere);
}
Как Linq переделать в вид :
var query = this.db.ShopRepository.Read(m =>
(filter.Address == null || m.address.Contains(filter.Address))
|| (filter.Title == null || m.shop_id.Contains(filter.Title))
)
.OrderBy(shop => shop.shop_id)
.ToList();
Ошибка:
42P08: не удалось определить тип данных параметра $1
Продвижение своими сайтами как стратегия роста и независимости