Advertisement
reqtrex

Untitled

Jan 21st, 2020
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.07 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text.Encodings.Web;
  5. using System.Text.Json;
  6. using System.Text.Unicode;
  7. using System.Threading.Tasks;
  8. using AutoMapper;
  9. using LingiWebApplication.Data;
  10. using LingiWebApplication.Data.Models;
  11. using Microsoft.AspNetCore.Identity;
  12. using Microsoft.AspNetCore.Mvc;
  13. using Microsoft.Extensions.Configuration;
  14.  
  15. namespace LingiWebApplication.Controllers
  16. {
  17.     public class LanguageController : BaseApiController
  18.     {
  19.         public LanguageController(
  20.             ApplicationDbContext context,
  21.             RoleManager<IdentityRole> roleManager,
  22.             UserManager<ApplicationUser> userManager,
  23.             IConfiguration configuration,
  24.             IMapper mapper
  25.             )
  26.             : base(context, roleManager, userManager, configuration, mapper) { }
  27.  
  28.  
  29.         [HttpGet]
  30.         public IActionResult Get()
  31.         {
  32.             List<Data.Models.Language> languages = DbContext.Languages.ToList();
  33.  
  34.             return new JsonResult(languages, JsonSettings);
  35.         }
  36.     }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement