0
質問があります。「カテゴリクラス」には多くの製品クラスが含まれています。しかし、今、私はすべての製品のすべてではなく、トップnを含むすべてのカテゴリーで同じ縫合でIListを実装するCategoryServiceクラスを持って、何をすべきですか?ありがとう!nhibernateマップカテゴリにはトップn製品が含まれています
コードリスト:
public class CategoryService
{
private ICategoryRepository categoryRepository;
public CategoryService(ICategoryRepository categoryRepository)
{
this.categoryRepository=categoryRepository;
}
public IList<Category> FindAll()
{
IList<Category> categories;
categories=categoryRepository.FindAll();
//and now i need categoryRepository find all category ,and every category contains top n product, what should i do;
return categories;
}
}
あなたがこれまでにしようとしているもの:
は、ドメインサービスがありますか?あなたのコードはどのように見えますか?私たちがあなたを助けるのを助けてください。 – Rippo
ありがとう!私の英語は良くありません! – alien
OK、結果はどのようにしたいですか? 'DTO'クラスや' Category.TopProducts'のようなものですか?また、TOP製品が何を意味しているのですか?これはグループ化された製品ですか? – Rippo