File tree Expand file tree Collapse file tree 3 files changed +5
-31
lines changed
ContosoUniversity/Features Expand file tree Collapse file tree 3 files changed +5
-31
lines changed Original file line number Diff line number Diff line change 1
- using System . Linq ;
2
- using System . Threading . Tasks ;
3
- using ContosoUniversity . Data ;
4
- using ContosoUniversity . Models ;
1
+ using System . Threading . Tasks ;
5
2
using MediatR ;
6
3
using Microsoft . AspNetCore . Mvc ;
7
- using Microsoft . EntityFrameworkCore ;
8
4
9
5
namespace ContosoUniversity . Features . Courses
10
6
{
11
7
public class CoursesController : Controller
12
8
{
13
- private readonly SchoolContext _context ;
14
9
private readonly IMediator _mediator ;
15
10
16
- public CoursesController ( SchoolContext context , IMediator mediator )
17
- {
18
- _context = context ;
19
- _mediator = mediator ;
20
- }
11
+ public CoursesController ( IMediator mediator ) => _mediator = mediator ;
21
12
22
13
// GET: Courses
23
14
public async Task < IActionResult > Index ( )
Original file line number Diff line number Diff line change 1
- using System . Linq ;
2
- using System . Threading . Tasks ;
3
- using ContosoUniversity . Data ;
4
- using ContosoUniversity . Models ;
1
+ using System . Threading . Tasks ;
5
2
using MediatR ;
6
3
using Microsoft . AspNetCore . Mvc ;
7
- using Microsoft . AspNetCore . Mvc . Rendering ;
8
- using Microsoft . EntityFrameworkCore ;
9
4
10
5
namespace ContosoUniversity . Features . Departments
11
6
{
12
7
public class DepartmentsController : Controller
13
8
{
14
- private readonly SchoolContext _context ;
15
9
private readonly IMediator _mediator ;
16
10
17
- public DepartmentsController ( SchoolContext context , IMediator mediator )
18
- {
19
- _context = context ;
20
- _mediator = mediator ;
21
- }
11
+ public DepartmentsController ( IMediator mediator ) => _mediator = mediator ;
22
12
23
13
// GET: Departments
24
14
public async Task < IActionResult > Index ( )
Original file line number Diff line number Diff line change 1
- using System ;
2
- using System . Collections . Generic ;
3
- using System . Linq ;
4
- using System . Threading . Tasks ;
5
- using ContosoUniversity . Data ;
6
- using ContosoUniversity . Models ;
7
- using ContosoUniversity . Models . SchoolViewModels ;
1
+ using System . Threading . Tasks ;
8
2
using MediatR ;
9
3
using Microsoft . AspNetCore . Mvc ;
10
- using Microsoft . EntityFrameworkCore ;
11
4
12
5
namespace ContosoUniversity . Features . Instructors
13
6
{
You can’t perform that action at this time.
0 commit comments