【发布时间】:2013-03-12 16:39:16
【问题描述】:
我应该将此方法放入我的 ISchoolclassCodeRepository 还是我的 ISchoolclassService 中?
/// <summary>
/// The client passes newly created and existing schoolclass codes.
/// The newly created schoolclass codes are returned.
/// </summary>
/// <param name="newAndExistingSchoolclassCodes">All schoolclass codes and the newly created by the user</param>
/// <param name="schoolyearId">The related schoolyear for a schoolclass code</param>
/// <returns>The newly created schoolclass codes</returns>
public IEnumerable<SchoolclassCode> GetNewCreatedSchoolclassCode(IEnumerable<SchoolclassCode> newAndExistingSchoolclassCodes, int schoolyearId)
{
var existingSchoolclassCodes = _uniOfWork.SchoolclassCodeRepository.GetSchoolclassCodes(schoolyearId).ToList();
var newSchoolclassCodes = existingSchoolclassCodes.Except(newAndExistingSchoolclassCodes,new SchoolclassCodeComparer());
return newSchoolclassCodes;
}
【问题讨论】:
标签: c# repository-pattern service-layer