kindly me how write below sql query entity framework lambda expression:
select count(subcategoryname) dc_subsystem_asset subcategoryid=1 , dc_countryid=114 , dc_locationid=1
assuming have dbcontext set entities, might like:
int count = _context.dc_subsystem_assets.count( => a.subcategoryid == 1 && a.dc_countryid == 114 && a.dc_locationid == 1 && a.subcategoryname != null); we need a.subcategoryname != null condition, because in sql count(column_name) doesn't include null values in count;
Comments
Post a Comment