public IEnumerable <Candidate> SearchCandidates(SearchCandidate filter) { //var p1 = new SqlParameter("@Id", id); //var author = db.Authors.FromSqlRaw($"SELECT * From Authors Where AuthorId = @Id", p1).FirstOrDefault() var whereCondition = BuildQuery.ConcatStringFilters(filter); var candidates = context.Candidates.FromSqlRaw($"select * from Candidates {whereCondition}"); return(candidates.ToList()); }