/// <summary> /// /// </summary> /// <returns>a list containing all genres</returns> public List<Genre> GetAll() { using (var ctx = new MovieShopContext()) { return ctx.Genres.ToList(); } }
/// <summary> /// Returns a customer with a specified Email /// </summary> /// <param name="email">The email of the customer that is wanted</param> /// <returns></returns> public Customer GetCustomer(string email) { using (var ctx = new MovieShopContext()) { Customer cust = ctx.Customers.Select(c => c.Email); return cust; } }
/// <summary> /// /// </summary> /// <returns>a list containing all customers</returns> public List<Customer> GetAll() { using (var ctx = new MovieShopContext()) { return ctx.Customers.ToList(); } }
public List<Movie> GetAllMovies() { using(var ctx = new MovieShopContext()) { return ctx.Movies.ToList(); } }
/// <summary> /// Adds a genre to the database /// </summary> /// <param name="gen">the genre to be added</param> public void Add(Genre gen) { using (var ctx = new MovieShopContext()) { ctx.Genres.Add(gen); ctx.SaveChanges(); } }
public void Add(Customer cust) { using(var ctx = new MovieShopContext()) { ctx.Customers.Add(cust); ctx.SaveChanges(); } }
/// <summary> /// Adds a genre to the database /// </summary> /// <param name="ord">the order to be added</param> public void Add(Order ord) { using (var ctx = new MovieShopContext()) { ctx.Orders.Add(ord); ctx.SaveChanges(); } }
public void Add(Movie movie) { using(var ctx = new MovieShopContext()) { ctx.Movies.Add(movie); ctx.SaveChanges(); } }