public List <MoviesVM> GetMovieByGenre(Genre genre) { var filteredMovies = _movieRepo.GetAll().Where(x => x.MovieGenre == genre).ToList(); var vms = Mappers.MapMoviesToMoviesVM(filteredMovies); return(vms); }
public bool CreateOrder(OrderVM order) { var orders = _orderReop.GetAll().ToList(); Order newOrder = new Order() { Movie = new List <Movie>(), User = new User() }; if (!orders.Equals(order)) { return(false); } _orderReop.Create(newOrder); Mappers.FromOrderToOrderVM(newOrder); return(true); }
public bool CreateUser(UserVM user) { var users = _userReop.GetAll().ToList(); User newUser = new User() { Name = user.Name, LastName = user.LastName, Email = user.Email, UserName = user.UserName, Password = user.Password, PhoneNumber = user.PhoneNumber, Order = new List <Order>() }; if (!users.Equals(user)) { return(false); } _userReop.Create(newUser); Mappers.MapUserToUserVM(newUser); return(true); }