Skip to content

Commit

Permalink
Added controllers, display names to models, cshtml views, and modifie…
Browse files Browse the repository at this point in the history
…d intializer, DbContext, and Layout.
  • Loading branch information
VoodooShoes committed Aug 15, 2022
1 parent 2bb6baa commit b7228b0
Show file tree
Hide file tree
Showing 21 changed files with 887 additions and 24 deletions.
21 changes: 21 additions & 0 deletions Controllers/ActorController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using eCommerce.Data;
using Microsoft.AspNetCore.Mvc;

namespace eCommerce.Controllers
{
public class ActorController : Controller
{
private readonly AppDbContext _context;

public ActorController(AppDbContext AppDbContext)
{
_context = AppDbContext;
}

public IActionResult Index()
{
var data = _context.Actors.ToList();
return View(data);
}
}
}
21 changes: 21 additions & 0 deletions Controllers/CinemaController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using eCommerce.Data;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;

namespace eCommerce.Controllers
{
public class CinemaController : Controller
{
private readonly AppDbContext _context;

public CinemaController(AppDbContext AppDbContext)
{
_context = AppDbContext;
}
public async Task<IActionResult> Index()
{
var allCinemas = await _context.Cinemas.ToListAsync();
return View(allCinemas);
}
}
}
21 changes: 21 additions & 0 deletions Controllers/MovieController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using eCommerce.Data;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;

namespace eCommerce.Controllers
{
public class MovieController : Controller
{
private readonly AppDbContext _context;

public MovieController(AppDbContext AppDbContext)
{
_context = AppDbContext;
}
public async Task<IActionResult> Index()
{
var allMovies = await _context.Movies.Include(n => n.Cinemas).OrderBy(n => n.Name).ToListAsync();
return View(allMovies);
}
}
}
21 changes: 21 additions & 0 deletions Controllers/ProducerController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using eCommerce.Data;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;

namespace eCommerce.Controllers
{
public class ProducerController : Controller
{
private readonly AppDbContext _context;

public ProducerController(AppDbContext AppDbContext)
{
_context = AppDbContext;
}
public async Task<IActionResult> Index()
{
var allProducers = await _context.Producers.ToListAsync();
return View(allProducers);
}
}
}
2 changes: 1 addition & 1 deletion Data/AppDbInitializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public static void Seed(IApplicationBuilder applicationBuilder)
{
FullName = "A. J. Cook",
Bio = "Andrea Joy Cook is a Canadian actress. She is best known for her role as Supervisory Special Agent Jennifer Jareau on the CBS crime drama Criminal Minds. Cook has also appeared in The Virgin Suicides, Higher Ground, Ripper, Out Cold, Final Destination 2, and Tru Calling.",
ProfilePictureURL = "C:/Users/asus/Desktop/eCommerce/wwwroot/lib/Images/Actors/a_j_cook.png"
ProfilePictureURL = "eCommerce//wwwroot//lib//Images//Actors//a_j_cook.png"
},
new ActorModel()
{
Expand Down
222 changes: 222 additions & 0 deletions Migrations/20220814004448_add-migration.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b7228b0

Please sign in to comment.