/// <summary> /// Creates all the profiles parsed. /// </summary> /// <param name="entities"></param> /// <returns></returns> public List <ProfileBO> CreateAll(List <ProfileBO> entities) { using (var uow = _facade.UnitOfWork) { var profiles = new List <ProfileBO>(); foreach (var entity in entities) { profiles.Add(_converter.Convert(uow.ProfileRepository.Create(_converter.Convert(entity)))); } uow.Complete(); return(profiles); } }
public ProfileBO Create(ProfileBO profile) { if (profile == null) { return(null); } using (var unitOfWork = _facade.UnitOfWork) { var createdProfile = unitOfWork.ProfileRepository.Create(_converter.Convert(profile)); unitOfWork.Complete(); return(_converter.Convert(createdProfile)); } }
public List <UserBO> GetAll() { using (var uow = _facade.UnitOfWork) { var users = uow.UserRepository.GetAll().Select(_userConverter.Convert).ToList(); foreach (var user in users) { user.Profile = _profileConverter.Convert(uow.ProfileRepository.Get(user.Id)); } return(users); } }
private ProfileResult Convert(Requirement project, string indexId) { var profileListView = mapper.Map <Requirement, ProfileListView>(project); var profileConverter = new ProfileConverter(profileListView, indexId); var projectProfileResult = profileConverter.Convert(); return(projectProfileResult); }
public ProfileBO Create(ProfileBO profile) { using (var uow = facade.UnitOfWork) { var newProfile = uow.ProfileRepo.Create(conv.Convert(profile)); uow.Complete(); return(conv.Convert(newProfile)); } }