public bool ChangePassword(ChangePasswordDto changePasswordDto) { User user = GetLoggedUser(); if (user == null) { return(false); } user.Password = PasswordUtils.ComputeHash(changePasswordDto.NewPassword); return(_genericDao.Persist <User>(user) != null); }
private static void SetDefaultCollectionToPaintingsInRemovedCollection(IUnitOfWork unitOfWork, Guid collectionId) { GenericDao genericDao = new GenericDao(unitOfWork); PaintingCRUDService paintingCRUDService = new PaintingCRUDService(unitOfWork); IList <Painting> paintingsToUpdate = genericDao.Find <Painting>(x => x.CollectionId == collectionId); foreach (Painting paintingToUpdate in paintingsToUpdate) { paintingToUpdate.CollectionId = GuidConstants.DEFAULT_COLLECTION_ID; } genericDao.Persist <Painting>(paintingsToUpdate); }
/// <summary> /// Does the persist to the database. /// </summary> /// <param name="entity">The entity to persist</param> /// <returns>Persisted entity</returns> protected virtual U DoPersist(U entity) { return(_genericDao.Persist <U>(entity)); }