-
Notifications
You must be signed in to change notification settings - Fork 5
/
FindResult.cs
40 lines (37 loc) · 1.49 KB
/
FindResult.cs
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
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="FindResult.cs" company="Kephas Software SRL">
// Copyright (c) Kephas Software SRL. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
// </copyright>
// <summary>
// Implements the find result class.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace Kephas.Data.Commands
{
using System;
/// <summary>
/// Encapsulates the result of a find command.
/// </summary>
public record FindResult : DataCommandResult, IFindResult
{
/// <summary>
/// Initializes a new instance of the <see cref="FindResult"/> class.
/// </summary>
/// <param name="entity">The found entity.</param>
/// <param name="message">Optional. The message.</param>
/// <param name="exception">Optional. The exception.</param>
public FindResult(object? entity, string? message = null, Exception? exception = null)
: base(message, exception)
{
this.Value = this.Entity = entity;
}
/// <summary>
/// Gets the found entity or <c>null</c> if no entity could be found.
/// </summary>
/// <value>
/// The found entity.
/// </value>
public object? Entity { get; }
}
}