37 lines
984 B
C#
37 lines
984 B
C#
|
|
using Google.Apis.Auth;
|
||
|
|
using Google.Apis.Http;
|
||
|
|
using Microsoft.AspNetCore.Authorization;
|
||
|
|
using Microsoft.AspNetCore.Mvc;
|
||
|
|
using Microsoft.Extensions.Configuration;
|
||
|
|
using Microsoft.Identity.Client.Platforms.Features.DesktopOs.Kerberos;
|
||
|
|
using Microsoft.IdentityModel.Tokens;
|
||
|
|
using System.Configuration;
|
||
|
|
using System.IdentityModel.Tokens.Jwt;
|
||
|
|
using System.Security.Claims;
|
||
|
|
using System.Text;
|
||
|
|
using WebAPI.Models;
|
||
|
|
|
||
|
|
namespace WebAPI.Controllers
|
||
|
|
{
|
||
|
|
[ApiController]
|
||
|
|
[Route("api/[controller]")]
|
||
|
|
[Authorize]
|
||
|
|
public class DataSetsController : Controller
|
||
|
|
{
|
||
|
|
private readonly AppDbContext db;
|
||
|
|
public DataSetsController(AppDbContext _db) { db = _db; }
|
||
|
|
|
||
|
|
[HttpGet]
|
||
|
|
public IActionResult GetAll()
|
||
|
|
{
|
||
|
|
try
|
||
|
|
{
|
||
|
|
return Ok(db.DataSets.Where(x => !x.IsDeleted).ToList());
|
||
|
|
}
|
||
|
|
catch (Exception e)
|
||
|
|
{
|
||
|
|
return BadRequest(e.ToString());
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|