Wie wähle ich unter Verwendung von Ardalis.specifikation in .NET unterschiedliche Werte aus?
Posted: 14 Feb 2025, 08:03
Ich versuche, eine bestimmte Liste von Marken aus meiner Produkttabelle mit Ardalis.Specification in einer .NET -Anwendung abzurufen. Aber es scheint, als ob eindeutig nicht funktioniert. < /P>
Es heißt Spezifikation enthält keine Definition für 'Unterscheidungs'
Code: Select all
public class GetDistinctManufacturersSpec : Specification
{
public GetDistinctManufacturersSpec(uint companyId)
{
_ = Query.Where(x => x.CompanyId == companyId && !string.IsNullOrEmpty(x.Manufacturer))
_ = Query.Select(x => x.Manufacturer).Distinct();
}
}