public bool AddNewRole(Role role) { if (_rolesDao.GetAll().Any(item => item.Title == role.Title)) { return(false); } _rolesDao.Add(role); return(true); }
public bool SignIn(string login, string password) { var user = _userDao.GetAll().FirstOrDefault(item => item.Name == login); if (user is null) { return(false); } return(password == _authUserDataDao.GetAll() .FirstOrDefault(item => item.UserId == user.Id).Password); }
public IEnumerable <TAssociatedEntity> GetAssociatedEntities(int entityId) { var document = XDocument.Load(_storageFileInfo.FullName); var associationsIdSet = (from element in document.Root.Elements() let association = element.FromXElement <XmlAssociationEntity>() let match = _isInverted ? association.SecondEntityId : association.FirstEntityId let associatedId = _isInverted ? association.FirstEntityId : association.SecondEntityId where match == entityId select associatedId).ToHashSet(); return(_associatedEntityWithIdDao.GetAll() .Where(entity => associationsIdSet.Contains(entity.Id))); }
public IEnumerable <Award> GetAllAwards() => _awardsDao.GetAll();
public IEnumerable <User> GetAllUsers() => _usersDao.GetAll();