Line | |
---|
1 | using Dal.ApplicationStorage;
|
---|
2 | using Microsoft.AspNetCore.Mvc;
|
---|
3 | using Microsoft.EntityFrameworkCore;
|
---|
4 | using Models.DatabaseModels;
|
---|
5 | using System.Diagnostics;
|
---|
6 |
|
---|
7 | namespace ocrent.Controllers
|
---|
8 | {
|
---|
9 | public class HomeController : Controller
|
---|
10 | {
|
---|
11 | private readonly ILogger<HomeController> _logger;
|
---|
12 | private readonly ApiContext _context;
|
---|
13 |
|
---|
14 | public HomeController(ILogger<HomeController> logger, ApiContext context)
|
---|
15 | {
|
---|
16 | _logger = logger;
|
---|
17 | _context = context;
|
---|
18 | }
|
---|
19 |
|
---|
20 | public async Task<IActionResult> Index()
|
---|
21 | {
|
---|
22 | var query = await (from users in _context.Users
|
---|
23 | join administrators in _context.Administrators
|
---|
24 | on users.UserId equals administrators.UserId
|
---|
25 | select new
|
---|
26 | {
|
---|
27 | users,
|
---|
28 | administrators,
|
---|
29 | }).ToListAsync();
|
---|
30 | return View();
|
---|
31 | }
|
---|
32 | public IActionResult Privacy()
|
---|
33 | {
|
---|
34 | var model = new Administrator();
|
---|
35 |
|
---|
36 | return View(model);
|
---|
37 | }
|
---|
38 |
|
---|
39 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
|
---|
40 | public IActionResult Error()
|
---|
41 | {
|
---|
42 | return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
|
---|
43 | }
|
---|
44 | }
|
---|
45 | } |
---|
Note:
See
TracBrowser
for help on using the repository browser.