public async Task CreateCashPaymentType(int projectid, int targetUserId) { var project = await ProjectRepository.GetProjectForFinanceSetup(projectid); project.RequestMasterAccess(CurrentUserId, acl => acl.CanManageMoney); project.RequestMasterAccess(targetUserId); var targetMaster = project.ProjectAcls.Single(a => a.UserId == targetUserId); if (targetMaster.GetCashPaymentType() != null) { throw new JoinRpgInvalidUserException(); } project.PaymentTypes.Add(PaymentType.CreateCash(targetMaster.UserId)); await UnitOfWork.SaveChangesAsync(); }