public async Task <UserProfile> GetUserProfileByUserId(Guid userId) { var specs = new GetUserProfileByUserIdSpecification(userId); var userProfile = await _unitOfWork.Repository <UserProfile>().GetEntityWithSpec(specs); return(userProfile); }
public async Task <IReadOnlyList <Payroll> > GetPayrollByUserProfileId(Guid userId) { var userProfileSpecs = new GetUserProfileByUserIdSpecification(userId); var userProfile = _unitOfWork.Repository <UserProfile>().GetEntityWithSpec(userProfileSpecs); var specs = new GetPayrollByUserProfileIdSpecification(userProfile.Id); var payroll = await _unitOfWork.Repository <Payroll>().ListAsync(specs); return(payroll); }