-
Notifications
You must be signed in to change notification settings - Fork 5
/
CreateEntityResult.cs
52 lines (47 loc) · 1.96 KB
/
CreateEntityResult.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
41
42
43
44
45
46
47
48
49
50
51
52
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="CreateEntityResult.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 create entity result class.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace Kephas.Data.Commands
{
using System;
using Kephas.Data.Capabilities;
/// <summary>
/// Encapsulates the result of a create entity command.
/// </summary>
public record CreateEntityResult : DataCommandResult, ICreateEntityResult
{
/// <summary>
/// Initializes a new instance of the <see cref="CreateEntityResult"/> class.
/// </summary>
/// <param name="entity">The created entity.</param>
/// <param name="entityEntry">Information describing the entity.</param>
/// <param name="message">Optional. The message.</param>
/// <param name="exception">Optional. The exception.</param>
public CreateEntityResult(object entity, IEntityEntry entityEntry, string? message = null, Exception? exception = null)
: base(message, exception)
{
this.Value = this.Entity = entity;
this.EntityEntry = entityEntry;
}
/// <summary>
/// Gets the created entity.
/// </summary>
/// <value>
/// The created entity or <c>null</c> if no entity could be created.
/// </value>
public object Entity { get; }
/// <summary>
/// Gets information describing the entity.
/// </summary>
/// <value>
/// Information describing the entity.
/// </value>
public IEntityEntry EntityEntry { get; }
}
}