• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

loresoft / MediatR.CommandQuery / 14067111219

25 Mar 2025 06:14PM UTC coverage: 59.397% (-0.5%) from 59.879%
14067111219

push

github

pwelter34
Update MediatorServiceExtensions.cs

495 of 971 branches covered (50.98%)

Branch coverage included in aggregate %.

0 of 3 new or added lines in 1 file covered. (0.0%)

113 existing lines in 15 files now uncovered.

1474 of 2344 relevant lines covered (62.88%)

22.57 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

83.33
/src/MediatR.CommandQuery/Commands/EntityUpdateCommand.cs
1
using System.Diagnostics.CodeAnalysis;
2
using System.Security.Claims;
3
using System.Text.Json.Serialization;
4

5
using MediatR.CommandQuery.Definitions;
6
using MediatR.CommandQuery.Services;
7

8
namespace MediatR.CommandQuery.Commands;
9

10
/// <summary>
11
/// A command to apply the <typeparamref name="TUpdateModel"/> to the entity with the specified identifier.
12
/// </summary>
13
/// <typeparam name="TKey">The type of the key.</typeparam>
14
/// <typeparam name="TUpdateModel">The type of the update model.</typeparam>
15
/// <typeparam name="TReadModel">The type of the read model.</typeparam>
16
public record EntityUpdateCommand<TKey, TUpdateModel, TReadModel>
17
    : EntityModelCommand<TUpdateModel, TReadModel>, ICacheExpire
18
{
19
    /// <summary>
20
    /// Initializes a new instance of the <see cref="EntityUpdateCommand{TKey, TUpdateModel, TReadModel}"/> class.
21
    /// </summary>
22
    /// <param name="principal">the <see cref="ClaimsPrincipal" /> this command is run for</param>
23
    /// <param name="id">The identifier to apply the update to.</param>
24
    /// <param name="model">The update model to apply.</param>
25
    /// <exception cref="System.ArgumentNullException">When <paramref name="id"/> or <paramref name="model"/> is null</exception>
26
    public EntityUpdateCommand(ClaimsPrincipal? principal, [NotNull] TKey id, TUpdateModel model) : base(principal, model)
16✔
27
    {
28
        ArgumentNullException.ThrowIfNull(id);
14✔
29

30
        Id = id;
14✔
31
    }
14✔
32

33
    /// <summary>
34
    /// Gets the identifier for entity to update.
35
    /// </summary>
36
    /// <value>
37
    /// The identifier for entity to update.
38
    /// </value>
39
    [NotNull]
40
    [JsonPropertyName("id")]
41
    public TKey Id { get; }
16✔
42

43
    /// <inheritdoc />
44
    string? ICacheExpire.GetCacheTag()
UNCOV
45
        => CacheTagger.GetTag<TReadModel>();
×
46
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc