Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public List<IdpTeamResponse> AddIdpTeamsBackoffice(List<IdpTeamRequest> idpTeams, string userLogin)
- {
- if (!Can(AccessRight.Add, userLogin, typeof(IdpTeam)))
- throw new UnauthorizedAccessException();
- ...............................
- dataManager.Save();
- var result = TestMain<IdpTeam, IdpTeamResponse>(dbIdpTeams, dataManager.IdpTeam);
- return result;
- }
- private List<TResult> TestMain<TBase, TResult>(List<TBase> list, IRepository<TBase> repository) where TBase : class, IEntity
- {
- var listIds = list.Select(x => x.Id);
- var newList = repository.GetAll().Where(x => listIds.Contains(x.Id)).ToList();
- var result = Mapper.Map<List<TBase>, List<TResult>>(newList);
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement