diff --git a/AsbCloudApp/Services/ICrudService.cs b/AsbCloudApp/Services/ICrudService.cs index c4b93207..24e8de6f 100644 --- a/AsbCloudApp/Services/ICrudService.cs +++ b/AsbCloudApp/Services/ICrudService.cs @@ -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 where Tdto : Data.IId { - int Delete(int id); - Tdto Get(int id); - IEnumerable GetAll(Expression> predicate = null); - Tdto Insert(Tdto newItem); - IEnumerable InsertRange(IEnumerable newItems); - Tdto Update(Tdto item); + Task GetAsync(int id, CancellationToken token = default); + Task InsertAsync(Tdto newItem, CancellationToken token = default); + Task> InsertRangeAsync(IEnumerable newItems, CancellationToken token = default); + Task UpdateAsync(Tdto item, CancellationToken token = default); + Task DeleteAsync(int id, CancellationToken token = default); + Task DeleteAsync(IEnumerable ids, CancellationToken token = default); } } \ No newline at end of file diff --git a/AsbCloudApp/Services/IWellSectionService.cs b/AsbCloudApp/Services/IWellSectionService.cs new file mode 100644 index 00000000..a7b22f19 --- /dev/null +++ b/AsbCloudApp/Services/IWellSectionService.cs @@ -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 + { + Task> GetAllByWellIdAsync(int idWell, int skip=0, int take=32, CancellationToken token = default); + } +}