Skip to content

Commit bf1639a

Browse files
authored
Merge pull request #1 from Calabonga/no-tracking-but-identity
Parameter for Tracking Changes type added
2 parents 4590194 + d3289b1 commit bf1639a

File tree

7 files changed

+1195
-11
lines changed

7 files changed

+1195
-11
lines changed

src/Calabonga.UnitOfWork/Calabonga.UnitOfWork.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
<PropertyGroup>
44
<TargetFrameworks>net8.0</TargetFrameworks>
5-
<Version>4.0.0</Version>
5+
<Version>5.0.0-beta.1</Version>
66
<Authors>Calabonga</Authors>
77
<Company>Calabonga SOFT</Company>
88
<Copyright>Calabonga SOFT © 2001-$([System.DateTime]::Now.ToString(yyyy))</Copyright>
99
<Description>Unit of Work implementation for EntityFramework Core. For more information please see Calabonga.UnitOfWork package. Perhaps, you might find more information on youtube.com/sergeicalabonga and www.calabonga.net</Description>
1010
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1111
<PackageIcon>logo.png</PackageIcon>
1212
<PackageTags>Calabonga EntityFrameworkCore UnitOfWork Repository Extenstion Helper unitofowrk ORM pagination PagedList pattern</PackageTags>
13-
<PackageReleaseNotes>NET8 migration. Pagination moved to its own nuget.</PackageReleaseNotes>
13+
<PackageReleaseNotes>TrackingType paramter eter createadded to split Nwith NoTraking, Trakcincnking asnnd NoTrackingWithIdentityResolution DbSet operations.</PackageReleaseNotes>
1414
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
1515
<PackageProjectUrl>https://www.calabonga.net</PackageProjectUrl>
1616
<Nullable>enable</Nullable>
@@ -21,8 +21,8 @@
2121

2222
<ItemGroup>
2323
<PackageReference Include="Calabonga.PagedListCore" Version="1.0.4" />
24-
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.2" />
25-
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.2" />
24+
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.10" />
25+
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.10" />
2626
</ItemGroup>
2727

2828
<ItemGroup>

src/Calabonga.UnitOfWork/IRepository.cs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace Calabonga.UnitOfWork;
1515
/// Defines the interfaces for generic repository.
1616
/// </summary>
1717
/// <typeparam name="TEntity">The type of the entity.</typeparam>
18-
public interface IRepository<TEntity> where TEntity : class
18+
public partial interface IRepository<TEntity> where TEntity : class
1919
{
2020
#region GetPagedList
2121

@@ -32,6 +32,7 @@ public interface IRepository<TEntity> where TEntity : class
3232
/// <param name="ignoreAutoIncludes">Ignore automatic includes</param>
3333
/// <returns>An <see cref="IPagedList{TEntity}"/> that contains elements that satisfy the condition specified by <paramref name="predicate"/>.</returns>
3434
/// <remarks>This method default no-tracking query.</remarks>
35+
[Obsolete("This method is will be removed in the future. Please use another overload for this method with TrackingType parameter instead.")]
3536
IPagedList<TEntity> GetPagedList(
3637
Expression<Func<TEntity, bool>>? predicate = null,
3738
Func<IQueryable<TEntity>, IOrderedQueryable<TEntity>>? orderBy = null,
@@ -58,6 +59,7 @@ IPagedList<TEntity> GetPagedList(
5859
/// <param name="ignoreAutoIncludes">Ignore automatic includes</param>
5960
/// <returns>An <see cref="IPagedList{TEntity}"/> that contains elements that satisfy the condition specified by <paramref name="predicate"/>.</returns>
6061
/// <remarks>This method default no-tracking query.</remarks>
62+
[Obsolete("This method is will be removed in the future. Please use another overload for this method with TrackingType parameter instead.")]
6163
Task<IPagedList<TEntity>> GetPagedListAsync(
6264
Expression<Func<TEntity, bool>>? predicate = null,
6365
Func<IQueryable<TEntity>, IOrderedQueryable<TEntity>>? orderBy = null,
@@ -83,6 +85,7 @@ Task<IPagedList<TEntity>> GetPagedListAsync(
8385
/// <param name="ignoreAutoIncludes">Ignore automatic includes</param>
8486
/// <returns>An <see cref="IPagedList{TResult}"/> that contains elements that satisfy the condition specified by <paramref name="predicate"/>.</returns>
8587
/// <remarks>This method default no-tracking query.</remarks>
88+
[Obsolete("This method is will be removed in the future. Please use another overload for this method with TrackingType parameter instead.")]
8689
IPagedList<TResult> GetPagedList<TResult>(
8790
Expression<Func<TEntity, TResult>> selector,
8891
Expression<Func<TEntity, bool>>? predicate = null,
@@ -111,6 +114,7 @@ IPagedList<TResult> GetPagedList<TResult>(
111114
/// <param name="ignoreAutoIncludes">Ignore automatic includes</param>
112115
/// <returns>An <see cref="IPagedList{TEntity}"/> that contains elements that satisfy the condition specified by <paramref name="predicate"/>.</returns>
113116
/// <remarks>This method default no-tracking query.</remarks>
117+
[Obsolete("This method is will be removed in the future. Please use another overload for this method with TrackingType parameter instead.")]
114118
Task<IPagedList<TResult>> GetPagedListAsync<TResult>(
115119
Expression<Func<TEntity, TResult>> selector,
116120
Expression<Func<TEntity, bool>>? predicate = null,
@@ -138,6 +142,7 @@ Task<IPagedList<TResult>> GetPagedListAsync<TResult>(
138142
/// <param name="ignoreAutoIncludes">Ignore automatic includes</param>
139143
/// <returns>An <see cref="IPagedList{TEntity}"/> that contains elements that satisfy the condition specified by <paramref name="predicate"/>.</returns>
140144
/// <remarks>This method defaults to a read-only, no-tracking query.</remarks>
145+
[Obsolete("This method is will be removed in the future. Please use another overload for this method with TrackingType parameter instead.")]
141146
TEntity? GetFirstOrDefault(
142147
Expression<Func<TEntity, bool>>? predicate = null,
143148
Func<IQueryable<TEntity>, IOrderedQueryable<TEntity>>? orderBy = null,
@@ -158,6 +163,7 @@ Task<IPagedList<TResult>> GetPagedListAsync<TResult>(
158163
/// <param name="ignoreAutoIncludes">Ignore automatic includes</param>
159164
/// <returns>An <see cref="IPagedList{TEntity}"/> that contains elements that satisfy the condition specified by <paramref name="predicate"/>.</returns>
160165
/// <remarks>This method defaults to a read-only, no-tracking query.</remarks>
166+
[Obsolete("This method is will be removed in the future. Please use another overload for this method with TrackingType parameter instead.")]
161167
TResult? GetFirstOrDefault<TResult>(
162168
Expression<Func<TEntity, TResult>> selector,
163169
Expression<Func<TEntity, bool>>? predicate = null,
@@ -179,6 +185,7 @@ Task<IPagedList<TResult>> GetPagedListAsync<TResult>(
179185
/// <param name="ignoreAutoIncludes">Ignore automatic includes</param>
180186
/// <returns>An <see cref="IPagedList{TEntity}"/> that contains elements that satisfy the condition specified by <paramref name="predicate"/>.</returns>
181187
/// <remarks>Ex: This method defaults to a read-only, no-tracking query.</remarks>
188+
[Obsolete("This method is will be removed in the future. Please use another overload for this method with TrackingType parameter instead.")]
182189
Task<TResult?> GetFirstOrDefaultAsync<TResult>(
183190
Expression<Func<TEntity, TResult>> selector,
184191
Expression<Func<TEntity, bool>>? predicate = null,
@@ -199,6 +206,7 @@ Task<IPagedList<TResult>> GetPagedListAsync<TResult>(
199206
/// <param name="ignoreAutoIncludes">Ignore automatic includes</param>
200207
/// <returns>An <see cref="IPagedList{TEntity}"/> that contains elements that satisfy the condition specified by <paramref name="predicate"/>.</returns>
201208
/// <remarks>Ex: This method defaults to a read-only, no-tracking query. </remarks>
209+
[Obsolete("This method is will be removed in the future. Please use another overload for this method with TrackingType parameter instead.")]
202210
Task<TEntity?> GetFirstOrDefaultAsync
203211
(
204212
Expression<Func<TEntity, bool>>? predicate = null,
@@ -243,6 +251,7 @@ Task<IPagedList<TResult>> GetPagedListAsync<TResult>(
243251
/// </summary>
244252
/// <returns>The <see cref="IQueryable{TEntity}"/>.</returns>
245253
/// /// <param name="disableTracking"><c>true</c> to disable changing tracking; otherwise, <c>false</c>. Default to <c>true</c>.</param>
254+
[Obsolete("This method is will be removed in the future. Please use another overload for this method with TrackingType parameter instead.")]
246255
IQueryable<TEntity> GetAll(bool disableTracking = true);
247256

248257
/// <summary>
@@ -251,6 +260,7 @@ Task<IPagedList<TResult>> GetPagedListAsync<TResult>(
251260
/// <param name="selector">The selector for projection.</param>
252261
/// <param name="disableTracking"><c>true</c> to disable changing tracking; otherwise, <c>false</c>. Default to <c>true</c>.</param>
253262
/// <returns>The <see cref="IQueryable{TEntity}"/>.</returns>
263+
[Obsolete("This method is will be removed in the future. Please use another overload for this method with TrackingType parameter instead.")]
254264
IQueryable<TResult> GetAll<TResult>(
255265
Expression<Func<TEntity, TResult>> selector,
256266
bool disableTracking = true);
@@ -262,6 +272,7 @@ IQueryable<TResult> GetAll<TResult>(
262272
/// <param name="predicate">A function to test each element for a condition.</param>
263273
/// <param name="disableTracking"><c>true</c> to disable changing tracking; otherwise, <c>false</c>. Default to <c>true</c>.</param>
264274
/// <returns>The <see cref="IQueryable{TEntity}"/>.</returns>
275+
[Obsolete("This method is will be removed in the future. Please use another overload for this method with TrackingType parameter instead.")]
265276
IQueryable<TResult> GetAll<TResult>(
266277
Expression<Func<TEntity, TResult>> selector,
267278
Expression<Func<TEntity, bool>>? predicate = null,
@@ -278,6 +289,7 @@ IQueryable<TResult> GetAll<TResult>(
278289
/// <param name="ignoreAutoIncludes">Ignore automatic includes</param>
279290
/// <returns>An <see cref="IPagedList{TEntity}"/> that contains elements that satisfy the condition specified by <paramref name="predicate"/>.</returns>
280291
/// <remarks>Ex: This method defaults to a read-only, no-tracking query.</remarks>
292+
[Obsolete("This method is will be removed in the future. Please use another overload for this method with TrackingType parameter instead.")]
281293
IQueryable<TEntity> GetAll(
282294
Expression<Func<TEntity, bool>>? predicate = null,
283295
Func<IQueryable<TEntity>, IOrderedQueryable<TEntity>>? orderBy = null,
@@ -298,6 +310,7 @@ IQueryable<TEntity> GetAll(
298310
/// <param name="ignoreAutoIncludes">Ignore automatic includes</param>
299311
/// <returns>An <see cref="IPagedList{TEntity}"/> that contains elements that satisfy the condition specified by <paramref name="predicate"/>.</returns>
300312
/// <remarks>Ex: This method defaults to a read-only, no-tracking query.</remarks>
313+
[Obsolete("This method is will be removed in the future. Please use another overload for this method with TrackingType parameter instead.")]
301314
IQueryable<TResult> GetAll<TResult>(
302315
Expression<Func<TEntity, TResult>> selector,
303316
Expression<Func<TEntity, bool>>? predicate = null,
@@ -312,6 +325,7 @@ IQueryable<TResult> GetAll<TResult>(
312325
/// </summary>
313326
/// <param name="disableTracking"><c>true</c> to disable changing tracking; otherwise, <c>false</c>. Default to <c>true</c>.</param>
314327
/// <returns>The <see cref="IQueryable{TEntity}"/>.</returns>
328+
[Obsolete("This method is will be removed in the future. Please use another overload for this method with TrackingType parameter instead.")]
315329
Task<IList<TEntity>> GetAllAsync(bool disableTracking = true);
316330

317331
/// <summary>
@@ -320,6 +334,7 @@ IQueryable<TResult> GetAll<TResult>(
320334
/// <param name="selector">The selector for projection.</param>
321335
/// <param name="disableTracking"><c>true</c> to disable changing tracking; otherwise, <c>false</c>. Default to <c>true</c>.</param>
322336
/// <returns>The <see cref="IQueryable{TEntity}"/>.</returns>
337+
[Obsolete("This method is will be removed in the future. Please use another overload for this method with TrackingType parameter instead.")]
323338
Task<IList<TResult>> GetAllAsync<TResult>(
324339
Expression<Func<TEntity, TResult>> selector,
325340
bool disableTracking = true);
@@ -335,6 +350,7 @@ Task<IList<TResult>> GetAllAsync<TResult>(
335350
/// <param name="ignoreAutoIncludes">Ignore automatic includes</param>
336351
/// <returns>An <see cref="IPagedList{TEntity}"/> that contains elements that satisfy the condition specified by <paramref name="predicate"/>.</returns>
337352
/// <remarks>Ex: This method defaults to a read-only, no-tracking query.</remarks>
353+
[Obsolete("This method is will be removed in the future. Please use another overload for this method with TrackingType parameter instead.")]
338354
Task<IList<TEntity>> GetAllAsync(
339355
Expression<Func<TEntity, bool>>? predicate = null,
340356
Func<IQueryable<TEntity>, IOrderedQueryable<TEntity>>? orderBy = null,
@@ -355,6 +371,7 @@ Task<IList<TEntity>> GetAllAsync(
355371
/// <param name="ignoreAutoIncludes">Ignore automatic includes</param>
356372
/// <returns>An <see cref="IPagedList{TEntity}"/> that contains elements that satisfy the condition specified by <paramref name="predicate"/>.</returns>
357373
/// <remarks>Ex: This method defaults to a read-only, no-tracking query.</remarks>
374+
[Obsolete("This method is will be removed in the future. Please use another overload for this method with TrackingType parameter instead.")]
358375
Task<IList<TResult>> GetAllAsync<TResult>(
359376
Expression<Func<TEntity, TResult>> selector,
360377
Expression<Func<TEntity, bool>>? predicate = null,

0 commit comments

Comments
 (0)