-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathEfDbMappedModel.Delete.cs
More file actions
42 lines (38 loc) · 2.92 KB
/
Copy pathEfDbMappedModel.Delete.cs
File metadata and controls
42 lines (38 loc) · 2.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
namespace CoreEx.EntityFrameworkCore;
public partial class EfDbMappedModel<TValue, TModel, TBiDirectionMapper>
{
/// <summary>
/// Deletes the model for the specified <paramref name="key"/>.
/// </summary>
/// <param name="key">The <see cref="CompositeKey"/>.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/>.</param>
/// <returns>A <see cref="DataResult"/></returns>
/// <remarks>A delete is considered idempotent and as such no <see cref="NotFoundException"/> will be thrown. The returning <see cref="DataResult.WasMutated"/> is informational only.</remarks>
public Task<DataResult> DeleteAsync(CompositeKey key, CancellationToken cancellationToken = default) => DeleteAsync(Model.Args, key, cancellationToken);
/// <summary>
/// Deletes the model for the specified <paramref name="key"/>.
/// </summary>
/// <param name="args">The <see cref="EfDbArgs"/>.</param>
/// <param name="key">The <see cref="CompositeKey"/>.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/>.</param>
/// <returns>A <see cref="DataResult"/></returns>
/// <remarks>A delete is considered idempotent and as such no <see cref="NotFoundException"/> will be thrown. The returning <see cref="DataResult.WasMutated"/> is informational only.</remarks>
public Task<DataResult> DeleteAsync(EfDbArgs args, CompositeKey key, CancellationToken cancellationToken = default) => Model.DeleteAsync(args, key, cancellationToken);
/// <summary>
/// Deletes the model for the specified <paramref name="key"/>.
/// </summary>
/// <param name="key">The <see cref="CompositeKey"/>.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/>.</param>
/// <returns>A <see cref="DataResult"/></returns>
/// <remarks>A delete is considered idempotent and as such no <see cref="NotFoundException"/> will be thrown. The returning <see cref="DataResult.WasMutated"/> is informational only.</remarks>
public Task<Result<DataResult>> DeleteWithResultAsync(CompositeKey key, CancellationToken cancellationToken = default) => DeleteWithResultAsync(Model.Args, key, cancellationToken);
/// <summary>
/// Deletes the model for the specified <paramref name="key"/>.
/// </summary>
/// <param name="args">The <see cref="EfDbArgs"/>.</param>
/// <param name="key">The <see cref="CompositeKey"/>.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/>.</param>
/// <returns>A <see cref="DataResult"/></returns>
/// <remarks>A delete is considered idempotent and as such no <see cref="NotFoundException"/> will be thrown. The returning <see cref="DataResult.WasMutated"/> is informational only.</remarks>
public Task<Result<DataResult>> DeleteWithResultAsync(EfDbArgs args, CompositeKey key, CancellationToken cancellationToken = default) => Model.DeleteWithResultAsync(args, key, cancellationToken);
}