forked from ddrilling/AsbCloudServer
make service async
This commit is contained in:
parent
8102442f81
commit
ddbf3ff2d5
@ -1,17 +1,17 @@
|
|||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
using System.Threading;
|
||||||
using System.Linq.Expressions;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace AsbCloudApp.Services
|
namespace AsbCloudApp.Services
|
||||||
{
|
{
|
||||||
public interface ICrudService<Tdto>
|
public interface ICrudService<Tdto>
|
||||||
where Tdto : Data.IId
|
where Tdto : Data.IId
|
||||||
{
|
{
|
||||||
int Delete(int id);
|
Task<Tdto> GetAsync(int id, CancellationToken token = default);
|
||||||
Tdto Get(int id);
|
Task<Tdto> InsertAsync(Tdto newItem, CancellationToken token = default);
|
||||||
IEnumerable<Tdto> GetAll(Expression<Func<object, bool>> predicate = null);
|
Task<IEnumerable<Tdto>> InsertRangeAsync(IEnumerable<Tdto> newItems, CancellationToken token = default);
|
||||||
Tdto Insert(Tdto newItem);
|
Task<Tdto> UpdateAsync(Tdto item, CancellationToken token = default);
|
||||||
IEnumerable<Tdto> InsertRange(IEnumerable<Tdto> newItems);
|
Task<int> DeleteAsync(int id, CancellationToken token = default);
|
||||||
Tdto Update(Tdto item);
|
Task<int> DeleteAsync(IEnumerable<int> ids, CancellationToken token = default);
|
||||||
}
|
}
|
||||||
}
|
}
|
12
AsbCloudApp/Services/IWellSectionService.cs
Normal file
12
AsbCloudApp/Services/IWellSectionService.cs
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
using AsbCloudApp.Data;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace AsbCloudApp.Services
|
||||||
|
{
|
||||||
|
public interface IWellSectionService: ICrudService<WellSectionDto>
|
||||||
|
{
|
||||||
|
Task<PaginationContainer<WellSectionDto>> GetAllByWellIdAsync(int idWell, int skip=0, int take=32, CancellationToken token = default);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user