diff --git a/Models/XRepositoryDescriptor.cs b/Models/XRepositoryDescriptor.cs index 00d1252..317c6cb 100644 --- a/Models/XRepositoryDescriptor.cs +++ b/Models/XRepositoryDescriptor.cs @@ -1,3 +1,5 @@ +using System; +using GraphQL.Types; using xDataService.Db; using xDataService.GraphQL; using xDataService.Interfaces; diff --git a/Providers/XBaseRepositoryService.cs b/Providers/XBaseRepositoryService.cs index 2233b4a..8954b49 100644 --- a/Providers/XBaseRepositoryService.cs +++ b/Providers/XBaseRepositoryService.cs @@ -108,7 +108,7 @@ namespace xDataService.Providers /// /// /// - public async Task AddAsync( + public virtual async Task AddAsync( TDto item, bool saveChanges = true, CancellationToken cancellationToken = default @@ -155,7 +155,7 @@ namespace xDataService.Providers /// /// /// - public async Task AddOrUpdateAsync( + public virtual async Task AddOrUpdateAsync( TDto item, bool saveChanges = true, CancellationToken cancellationToken = default @@ -202,15 +202,12 @@ namespace xDataService.Providers /// /// /// - public async Task AddRangeAsync( + public virtual async Task AddRangeAsync( IEnumerable items, bool saveChanges = true, CancellationToken cancellationToken = default ) { - // - TDto result = null; - // // Validate ... bool isValid = @@ -249,7 +246,7 @@ namespace xDataService.Providers /// /// /// - public async Task UpdateAsync( + public virtual async Task UpdateAsync( TKey id, TDto item, bool saveChanges = true, @@ -290,7 +287,7 @@ namespace xDataService.Providers /// /// /// - public async Task UpdateRangeAsync( + public virtual async Task UpdateRangeAsync( IEnumerable items, bool saveChanges = true, CancellationToken cancellationToken = default @@ -339,7 +336,7 @@ namespace xDataService.Providers /// /// /// - public async Task RemoveAsync( + public virtual async Task RemoveAsync( TKey id, bool softDelete = true, bool saveChanges = true, @@ -378,7 +375,7 @@ namespace xDataService.Providers /// /// /// - public async Task RemoveAsync( + public virtual async Task RemoveAsync( TDto item, bool softDelete = true, bool saveChanges = true, @@ -420,7 +417,7 @@ namespace xDataService.Providers /// /// /// - public async Task RemoveRangeAsync( + public virtual async Task RemoveRangeAsync( IEnumerable items, bool softDelete = true, bool saveChanges = true, @@ -464,7 +461,7 @@ namespace xDataService.Providers /// /// /// - public async Task CountAsync( + public virtual async Task CountAsync( bool ignoreSoftDeleteds = true, CancellationToken cancellationToken = default ) @@ -487,7 +484,7 @@ namespace xDataService.Providers /// /// /// - public async Task PagesCountAsync( + public virtual async Task PagesCountAsync( int pageSize, int? totalItems = null, bool ignoreSoftDeleteds = true, @@ -516,7 +513,7 @@ namespace xDataService.Providers /// /// /// - public async Task IsExistsAsync( + public virtual async Task IsExistsAsync( TKey id, bool ignoreSoftDeleteds = true, CancellationToken cancellationToken = default @@ -544,7 +541,7 @@ namespace xDataService.Providers /// /// /// - public async Task GetAsync( + public virtual async Task GetAsync( TKey id, bool ignoreSoftDeleteds = true, Func, IIncludableQueryable> includeBuilder = null, @@ -583,7 +580,7 @@ namespace xDataService.Providers /// /// /// - public async Task> GetAllAsync( + public virtual async Task> GetAllAsync( bool ignoreSoftDeleteds = true, Func, IOrderedQueryable> orderBuilder = null, Func, IIncludableQueryable> includeBuilder = null, @@ -623,7 +620,7 @@ namespace xDataService.Providers /// /// /// - public async IAsyncEnumerable GetAllAsAsyncEnumerable( + public virtual async IAsyncEnumerable GetAllAsAsyncEnumerable( bool ignoreSoftDeleteds = true, Func, IOrderedQueryable> orderBuilder = null, Func, IIncludableQueryable> includeBuilder = null, @@ -658,7 +655,7 @@ namespace xDataService.Providers /// /// /// - public async Task FindOneAsync( + public virtual async Task FindOneAsync( Expression> predicate, bool ignoreSoftDeleteds = true, Func, IIncludableQueryable> includeBuilder = null, @@ -698,7 +695,7 @@ namespace xDataService.Providers /// /// /// - public async Task> FindManyAsync( + public virtual async Task> FindManyAsync( Expression> predicate, bool ignoreSoftDeleteds = true, Func, IOrderedQueryable> orderBuilder = null, @@ -741,7 +738,7 @@ namespace xDataService.Providers /// /// /// - public async Task> QueryAsync( + public virtual async Task> QueryAsync( XQuery query, bool ignoreSoftDeleteds = true, Expression> predicate = null,