API
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using PARR.DAL.Context;
|
||||
using PARR.DAL.DomainModels;
|
||||
using PARR.DAL.Models.Base;
|
||||
using PARR.DAL.Services.Interfaces.Base;
|
||||
|
||||
@@ -109,11 +110,11 @@ namespace PARR.DAL.Services.Abstracts
|
||||
return await EntitySet.FirstOrDefaultAsync(t => t.Id == id);
|
||||
}
|
||||
|
||||
//public virtual IQueryable<T> GetPage(IQueryable<T> query, PaginationFilter paginationFilter)
|
||||
//{
|
||||
// int skip = (paginationFilter.PageNumber - 1) * paginationFilter.PageSize;
|
||||
public virtual IQueryable<T> GetPage(IQueryable<T> query, PaginationFilter paginationFilter)
|
||||
{
|
||||
int skip = (paginationFilter.PageNumber - 1) * paginationFilter.PageSize;
|
||||
|
||||
// return query.Skip(skip).Take(paginationFilter.PageSize);
|
||||
//}
|
||||
return query.Skip(skip).Take(paginationFilter.PageSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
22
PARR.DAL/Services/Implementations/SchedulerService.cs
Normal file
22
PARR.DAL/Services/Implementations/SchedulerService.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using PARR.DAL.Context;
|
||||
using PARR.DAL.Models;
|
||||
using PARR.DAL.Services.Abstracts;
|
||||
using PARR.DAL.Services.Interfaces;
|
||||
|
||||
namespace PARR.DAL.Services.Implementations
|
||||
{
|
||||
internal class SchedulerService : BaseService<Scheduler>, ISchedulerService
|
||||
{
|
||||
private readonly DataContext dataContext;
|
||||
|
||||
public SchedulerService(DataContext dataContext, ILogger<SchedulerService> logger) : base(logger)
|
||||
{
|
||||
this.dataContext = dataContext;
|
||||
}
|
||||
protected override DbSet<Scheduler> EntitySet => dataContext.Schedulers;
|
||||
|
||||
protected override DataContext EntitiContext => dataContext;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using PARR.DAL.Models.Base;
|
||||
using PARR.DAL.DomainModels;
|
||||
using PARR.DAL.Models.Base;
|
||||
|
||||
namespace PARR.DAL.Services.Interfaces.Base
|
||||
{
|
||||
@@ -6,7 +7,7 @@ namespace PARR.DAL.Services.Interfaces.Base
|
||||
{
|
||||
Task<T?> GetAsync(Guid id);
|
||||
IQueryable<T> Get();
|
||||
//IQueryable<T> GetPage(IQueryable<T> query, PaginationFilter paginationFilter);
|
||||
IQueryable<T> GetPage(IQueryable<T> query, PaginationFilter paginationFilter);
|
||||
|
||||
Task<bool> CreateAsync(T obj);
|
||||
Task<bool> AddRangeAsync(List<T> objs);
|
||||
|
||||
9
PARR.DAL/Services/Interfaces/ISchedulerService.cs
Normal file
9
PARR.DAL/Services/Interfaces/ISchedulerService.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using PARR.DAL.Models;
|
||||
using PARR.DAL.Services.Interfaces.Base;
|
||||
|
||||
namespace PARR.DAL.Services.Interfaces
|
||||
{
|
||||
public interface ISchedulerService : IBaseService<Scheduler>
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user