Reputation: 7092
I'm having trouble understanding why a part of my code can't resolve another part.
I have this class that contains two properties. The second property relies on the first, but it keeps throwing this error:
cannot resolve symbol 'yearlyEmployees'
public class Financials
{
public static IEnumerable<SalaryEntity> yearlyEmployees = FactoryManagement(12345);
//cannot resolve symbol 'yearlyEmployees'
public static IEnumerable<CompanyEntity> YearlyGroup(IList<yearlyEmployees> allExempt)
{
}
}
I'm sure there's an easy answer, but I just can't find it.
Thanks!
Upvotes: 1
Views: 379
Reputation: 666
yearlyEmployees
is a variable name, not a class name. Try:
public static IEnumerable<CompanyEntity> YearlyGroup(IList<SalaryEntity> allExempt)
Upvotes: 11
Reputation: 37299
That is because you don't have a type of yearlyEmplyee
- that is your variable.
Instead:
public static IEnumerable<CompanyEntity> YearlyGroup(IList<SalaryEntity> allExempt)
{ }
And then just pass a collection of SalaryEntity
to the function. If you always want to process only yearlyEmployees
(which I don't think is the case but not sure) then just call it from within the method `Financials.yearlyEmployees'.
Upvotes: 1
Reputation: 11
You must use the type SalaryEntity as item for your list.
public static IEnumerable<CompanyEntity> YearlyGroup(IList<SalaryEntity> allExempt) {}
Upvotes: 1