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.Linq.Expressions;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AsbCloudApp.Services
|
||||
{
|
||||
public interface ICrudService<Tdto>
|
||||
where Tdto : Data.IId
|
||||
{
|
||||
int Delete(int id);
|
||||
Tdto Get(int id);
|
||||
IEnumerable<Tdto> GetAll(Expression<Func<object, bool>> predicate = null);
|
||||
Tdto Insert(Tdto newItem);
|
||||
IEnumerable<Tdto> InsertRange(IEnumerable<Tdto> newItems);
|
||||
Tdto Update(Tdto item);
|
||||
Task<Tdto> GetAsync(int id, CancellationToken token = default);
|
||||
Task<Tdto> InsertAsync(Tdto newItem, CancellationToken token = default);
|
||||
Task<IEnumerable<Tdto>> InsertRangeAsync(IEnumerable<Tdto> newItems, CancellationToken token = default);
|
||||
Task<Tdto> UpdateAsync(Tdto item, CancellationToken token = default);
|
||||
Task<int> DeleteAsync(int id, CancellationToken token = default);
|
||||
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