I know I'm missing something obvious but for some reason I can't call a method from a class. I have one file named Searches with a SearchGroup method in it. I am attempting to call that method from another file by the following, but it's saying
'Searches' does not contain a definition for 'SearchGroup' :
List<Searches.NameScore> People = Searches.SearchGroup("Test");
My Searches class looks like:
public class Searches
{
private readonly IConfiguration _config;
public Searches(IConfiguration configuration)
{
_config = configuration;
}
public class FirstLoadGroup
{
public int IdGroup { get; set; }
public string Name { get; set; }
}
public class NameScore
{
public int Id { get; set; }
public string Name { get; set; }
public double Score { get; set; }
}
public async Task<List<NameScore>> SearchGroup(string Input)
{
//processy stuff
//Querying stuff
DataAccess data = new DataAccess();
string sql = "SELECT IdGroup, Name FROM Groups";
List<FirstLoadGroup> Names = await data.LoadData<FirstLoadGroup, dynamic>(sql, new { }, _config.GetConnectionString("DataDB"));
//Sorting and Comparing stuff
return SortedNames;
//return list of names in order of lowest to highest matching score
}
}