我想知道这是否有意义。
我有一个 DTO 模型:
public class CategoryListByKeywordsDetailDto : ILocalizable
{
public int Id { get; set; }
public string Name { get; set; }
public string NameEN { get; set; }
public string NameES { get; set; }
public string NameFR { get; set; }
public string NamePT { get; set; }
public int SearchCount { get; set; }
public string ListController { get; set; }
public string ListAction { get; set; }
}
以及它的清单
public class CategoryListByBeywordsListDto
{
public CategoryListByBeywordsListDto()
{
CategoryListByKeywordsDetails = new List<CategoryListByKeywordsDetailDto>();
}
public IList<CategoryListByKeywordsDetailDto> CategoryListByKeywordsDetails { get; set; }
public int TotalSearchCount { get; set; }
}
我可以根据'列表'实时计算TotalSearchCount
属性吗?CategoryListByKeywordsDetails
SearchCount