예제 #1
0
        public void ShareServiceDescriptionWithUser(int idServiceDescription, int idUserToShare)
        {
            var notYetShared = _serviceDescription_UserRepository.GetAllBySharedUser(idUserToShare).Count(x => x.IdServiceDescription == idServiceDescription) == 0;

            if (notYetShared)
            {
                var serviceDescription_User = new ServiceDescription_User
                {
                    IdServiceDescription = idServiceDescription,
                    IdSharedUser         = idUserToShare
                };

                _serviceDescription_UserRepository.Create(serviceDescription_User);

                _serviceDescription_UserRepository.SaveChanges();
            }
        }
예제 #2
0
 public List <ServiceDescription_User> GetAllBySharedUser(int idUser)
 {
     return(_serviceDescription_UserRepository.GetAllBySharedUser(idUser).ToList());
 }