initial commit
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
using Indotalent.Data.Entities;
|
||||
using Indotalent.Infrastructure.Database;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.OData.Query;
|
||||
using Microsoft.AspNetCore.OData.Routing.Controllers;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Indotalent.Features.Serilogs;
|
||||
|
||||
[Route("odata/SerilogLogs")]
|
||||
public class SerilogsODataController : ODataController
|
||||
{
|
||||
private readonly AppDbContext _context;
|
||||
|
||||
public SerilogsODataController(AppDbContext context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
||||
[EnableQuery]
|
||||
[HttpGet]
|
||||
public IQueryable<SerilogLogs> Get()
|
||||
{
|
||||
return _context.Set<SerilogLogs>()
|
||||
.OrderByDescending(x => x.TimeStamp)
|
||||
.AsNoTracking();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user