public bool AddAttraction(AttractionDTO attractionDTO) { User user = _repository.GetUserByEmail(attractionDTO.EmailUser); if (_repository.CheckUserPriority(user, 20) == false) { return(false); } AttractionType attractionType = _repository.GetAttractionTypeByTitle(attractionDTO.Title); Location location = new Location() { Address = attractionDTO.Address, PostalCode = attractionDTO.PostalCode }; return(_repository.AddAttraction(new Attraction() { AttractionType = attractionType, User = user, Name = attractionDTO.Name, Description = attractionDTO.Description, Rating = 0, PhoneNumber = attractionDTO.PhoneNumber, OpenTime = attractionDTO.OpenTime, CloseTime = attractionDTO.CloseTime, CreateAtractionTime = DateTime.Now, Location = location, ImagePath = @attractionDTO.Base64ToImage(attractionDTO.Image), })); }