source: Application/ocrent/Controllers/HomeController.cs

Last change on this file was f5f7c24, checked in by 192011 <mk.snicker@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 1.4 KB
Line 
1using Dal.ApplicationStorage;
2using Microsoft.AspNetCore.Mvc;
3using Microsoft.EntityFrameworkCore;
4using Models.DatabaseModels;
5using System.Diagnostics;
6
7namespace 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.