public int GetIdByText(string taxName) { var predicate = PredicateBuilder.True <lmsTaxMaster>(); var item = taxRepository.FindBy(predicate.And(x => x.TAXNAME == taxName)).ToList(); return(item.Any() ? item.Single().TAXID : 0); }