Encamina.Enmarcha.Entities.Abstractions
8.1.7-preview-06
See the version list below for details.
dotnet add package Encamina.Enmarcha.Entities.Abstractions --version 8.1.7-preview-06
NuGet\Install-Package Encamina.Enmarcha.Entities.Abstractions -Version 8.1.7-preview-06
<PackageReference Include="Encamina.Enmarcha.Entities.Abstractions" Version="8.1.7-preview-06" />
paket add Encamina.Enmarcha.Entities.Abstractions --version 8.1.7-preview-06
#r "nuget: Encamina.Enmarcha.Entities.Abstractions, 8.1.7-preview-06"
// Install Encamina.Enmarcha.Entities.Abstractions as a Cake Addin #addin nuget:?package=Encamina.Enmarcha.Entities.Abstractions&version=8.1.7-preview-06&prerelease // Install Encamina.Enmarcha.Entities.Abstractions as a Cake Tool #tool nuget:?package=Encamina.Enmarcha.Entities.Abstractions&version=8.1.7-preview-06&prerelease
Entities - Abstractions
Entities Abstractions is a project that primarily contains abstractions used by other NuGet packages in ENMARCHA. These abstractions represent properties or characteristics that entities can have.
Setup
Nuget package
First, install NuGet. Then, install Encamina.Enmarcha.Entities.Abstractions from the package manager console:
PM> Install-Package Encamina.Enmarcha.Entities.Abstractions
.NET CLI:
Install .NET CLI. Next, install Encamina.Enmarcha.Entities.Abstractions from the .NET CLI:
dotnet add package Encamina.Enmarcha.Entities.Abstractions
How to use
HandlerManagerBase
HandlerManagerBase is a base class for a handlers manager. It serves as a foundation for handling various types of handlers. You can use it as a starting point for creating specialized handler manager classes.
public class CustomHandler
{
}
public class MyCustomHandlerManager : HandlerManagerBase<CustomHandler>
{
public MyCustomHandlerManager(IEnumerable<CustomHandler> handlers) : base(handlers)
{
}
public void LoopHandlers()
{
foreach (var handler in Handlers)
{
// ...
}
}
}
In the previous code, a class is created based on HandlerManagerBase
where all the Handlers
are looped in the LoopHandlers
method.
HandlerProcessTimes
HandlerProcessTimes is an Enum that represents the process time when a specific handler should be executed. It has 4 possible values:
- None: Indicates the handled should never be processed.
- Begin: Indicates the handler should be processed at the beginning of the turn context.
- End: Indicates the handler should be processed at the ending of the turn context.
- Both: Indicates the handler should be processed at both, the beginning and the ending of the turn context.
IIdentifiable/IdentifiableBase
- IIdentifiable is an interface that represents a uniquely identifiable entity.
- IIdentifiable<T> is an interface that represents a uniquely identifiable entity.
- IdentifiableBase is a base class for entities that must have a property that represents a unique identifier. It implements
IIdentifiable
. - IdentifiableBase<T> is a base class for entities that must have a property that represents a unique identifier. It implements
IIdentifiable<T>
.
public class MyCustomIdentifiableEntity : IIdentifiable
{
public object Id { get; }
}
public class MyCustomTypedIdentifiableEntity : IIdentifiable<string>
{
object IIdentifiable.Id => Id;
public string Id { get; }
}
public class MyCustomIdentifiableBaseEntity : IdentifiableBase
{
}
public class MyCustomTypedIdentifiableBaseEntity : IdentifiableBase<string>
{
}
IIdentifiableValuable
IIdentifiableValuable is an interface that represents entities with an unique identifier and value. It implements IIdentifiable<T>
and IValuable<T>
.
public class MyCustomIdentifiableAndValuableEntity : IIdentifiableValuable<Guid, string>
{
public string Value { get; }
object IIdentifiable.Id => Id;
public Guid Id { get; }
}
IIntendable
IIntendable is an interface that represents an intendable entity. In other words, and entity that has an intent.
public class MyCustomIntendableEntity : IIntendable
{
public string Intent { get; }
}
INameable
INameable is an interface that represents a nameable entity.
public class MyCustomNameableEntity : INameable
{
public string Name { get; }
}
INameableIdentifiable
INameableIdentifiable is an interface that represents entities with a name and an unique identifier. It implements INameable
and IIdentifiable<T>
.
public class MyCustomNameableAndIdentifiableEntity : INameableIdentifiable<Guid>
{
public string Name { get; }
object IIdentifiable.Id => Id;
public Guid Id { get; }
}
INameableIdentifiableValuable
INameableIdentifiableValuable is an interface that represents entities with a name, an unique identifier and value. It implements INameable
, IIdentifiable<T>
and IValuable<T>
.
public class MyCustomNameableAndIdentifiableAndValuableEntity : INameableIdentifiableValuable<Guid, int>
{
public string Name { get; }
object IIdentifiable.Id => Id;
public Guid Id { get; }
public int Value { get; }
}
INameableValuable
INameableValuable is an interface that represents entities with a name and value. It implements INameable
and IValuable<T>
. This is an alternative to KeyValuePair and KeyValuePair{TKey, TValue}. The latter two do not support inheritance because KeyValuePair is a static class and KeyValuePair{TKey, TValue} is a structure.
public class MyCustomNameableAndValuableEntity : INameableValuable<int>
{
public string Name { get; }
public int Value { get; }
}
IOrderable
IOrderable is an interface that represents an orderable type.
public class MyCustomOrderableEntity : IOrderable
{
public int Order { get; }
}
IRetryHelper
IRetryHelper is an interface that represents a helper for retrying failed operations.
public class MyCustomRetryHelper : IRetryHelper
{
public Task RetryOperationAsync(int retryTimes, int waitTimeMilliseconds, Func<Task> operation)
{
// ...
// Implementation of retry operation
// ...
return Task.CompletedTask;
}
}
There is an implementation of this interface in the NuGet package Encamina.Enmarcha.Entities, SimpleRetryHelper.
IServiceFactory/IServiceFactoryProvider
- IServiceFactory<T> is an interface that represents a factory that can provide valid instances of a specific service of type
T
within a scope. There is an implementation of this interface in the NuGet package Encamina.Enmarcha.Entities, ServiceFactory<T>. - IServiceFactoryProvider<T> is an interface that represents a provider for factories of services of type
T
. There is an implementation of this interface in the NuGet package Encamina.Enmarcha.Entities, ServiceFactoryProvider<T>.
IValidableEntity/ValidableEntity
- IValidableEntity is an interface that represents entities that provides their own validation mechanism.
- ValidableEntity is a base class that represents an entity that can be validated by itself. It implements
IValidableEntity
.
public class MyCustomValidableEntity : ValidableEntity
{
public string SomeProperty { get; set; }
public override IEnumerable<string> Validate()
{
var validationResults = base.Validate().ToList();
if (string.IsNullOrWhiteSpace(SomeProperty))
{
validationResults.Add("SomeProperty must not be empty.");
}
return validationResults;
}
}
IValuable
IValuable is an interface that represents an entity with value.
public class MyCustomValuableEntity : IValuable<double>
{
public double Value { get; }
}
NameableHandlerManagerBase
NameableHandlerManagerBase is a base class for a handlers manager that uses handlers that implements the INameable
interface.
public class CustomNameableHandler : INameable
{
public CustomNameableHandler(string name)
{
Name = name;
}
public string Name { get; }
}
public class MyCustomHandlerManager : NameableHandlerManagerBase<CustomNameableHandler>
{
public MyCustomHandlerManager(IEnumerable<CustomNameableHandler> handlers) : base(handlers)
{
}
public void LoopHandlers()
{
foreach (var handler in Handlers)
{
Console.WriteLine($"{handler.Value}");
}
}
}
In the code above, a class is created based on NameableHandlerManagerBase
where all the Handlers
are looped in the LoopHandlers
method.
OrderableHandlerManagerBase
OrderableHandlerManagerBase is a base class for a handlers manager that uses handlers that implements the IOrderable
interface.
public class CustomOrderableHandler : IOrderable
{
public CustomOrderableHandler(int order)
{
Order = order;
}
public int Order{ get; }
}
public class MyCustomHandlerManager : OrderableHandlerManagerBase<CustomOrderableHandler>
{
public MyCustomHandlerManager(IEnumerable<CustomOrderableHandler> handlers) : base(handlers)
{
}
public void LoopHandlers()
{
foreach (var handler in Handlers)
{
Console.WriteLine($"{handler.Order}");
}
}
}
In the code above, a class is created based on OrderableHandlerManagerBase
where all the Handlers
are looped in order by the LoopHandlers
method.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- CommunityToolkit.Diagnostics (>= 8.2.2)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.1)
- System.ComponentModel.Annotations (>= 5.0.0)
NuGet packages (13)
Showing the top 5 NuGet packages that depend on Encamina.Enmarcha.Entities.Abstractions:
Package | Downloads |
---|---|
Encamina.Enmarcha.AI.Abstractions
Package Description |
|
Encamina.Enmarcha.AI.IntentsPrediction.Abstractions
Package Description |
|
Encamina.Enmarcha.AI.TextsTranslation.Abstractions
Package Description |
|
Encamina.Enmarcha.AI.LanguagesDetection.Abstractions
Package Description |
|
Encamina.Enmarcha.Entities
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
8.2.0 | 1,537 | 10/22/2024 |
8.2.0-preview-01-m01 | 784 | 9/17/2024 |
8.1.9-preview-03 | 597 | 11/19/2024 |
8.1.9-preview-02 | 535 | 10/22/2024 |
8.1.9-preview-01 | 860 | 10/4/2024 |
8.1.8 | 1,568 | 9/23/2024 |
8.1.8-preview-07 | 1,389 | 9/12/2024 |
8.1.8-preview-06 | 956 | 9/11/2024 |
8.1.8-preview-05 | 766 | 9/10/2024 |
8.1.8-preview-04 | 1,143 | 8/16/2024 |
8.1.8-preview-03 | 832 | 8/13/2024 |
8.1.8-preview-02 | 717 | 8/13/2024 |
8.1.8-preview-01 | 732 | 8/12/2024 |
8.1.7 | 856 | 8/7/2024 |
8.1.7-preview-09 | 734 | 7/3/2024 |
8.1.7-preview-08 | 695 | 7/2/2024 |
8.1.7-preview-07 | 682 | 6/10/2024 |
8.1.7-preview-06 | 657 | 6/10/2024 |
8.1.7-preview-05 | 702 | 6/6/2024 |
8.1.7-preview-04 | 652 | 6/6/2024 |
8.1.7-preview-03 | 697 | 5/24/2024 |
8.1.7-preview-02 | 546 | 5/10/2024 |
8.1.7-preview-01 | 624 | 5/8/2024 |
8.1.6 | 2,216 | 5/7/2024 |
8.1.6-preview-08 | 651 | 5/2/2024 |
8.1.6-preview-07 | 696 | 4/29/2024 |
8.1.6-preview-06 | 1,278 | 4/26/2024 |
8.1.6-preview-05 | 729 | 4/24/2024 |
8.1.6-preview-04 | 706 | 4/22/2024 |
8.1.6-preview-03 | 673 | 4/22/2024 |
8.1.6-preview-02 | 797 | 4/17/2024 |
8.1.6-preview-01 | 797 | 4/15/2024 |
8.1.5 | 864 | 4/15/2024 |
8.1.5-preview-15 | 679 | 4/10/2024 |
8.1.5-preview-14 | 730 | 3/20/2024 |
8.1.5-preview-13 | 629 | 3/18/2024 |
8.1.5-preview-12 | 693 | 3/13/2024 |
8.1.5-preview-11 | 615 | 3/13/2024 |
8.1.5-preview-10 | 655 | 3/13/2024 |
8.1.5-preview-09 | 665 | 3/12/2024 |
8.1.5-preview-08 | 662 | 3/12/2024 |
8.1.5-preview-07 | 638 | 3/8/2024 |
8.1.5-preview-06 | 955 | 3/8/2024 |
8.1.5-preview-05 | 647 | 3/7/2024 |
8.1.5-preview-04 | 725 | 3/7/2024 |
8.1.5-preview-03 | 693 | 3/7/2024 |
8.1.5-preview-02 | 834 | 2/28/2024 |
8.1.5-preview-01 | 738 | 2/19/2024 |
8.1.4 | 1,113 | 2/15/2024 |
8.1.3 | 901 | 2/13/2024 |
8.1.3-preview-07 | 669 | 2/13/2024 |
8.1.3-preview-06 | 701 | 2/12/2024 |
8.1.3-preview-05 | 675 | 2/9/2024 |
8.1.3-preview-04 | 662 | 2/8/2024 |
8.1.3-preview-03 | 670 | 2/7/2024 |
8.1.3-preview-02 | 725 | 2/2/2024 |
8.1.3-preview-01 | 692 | 2/2/2024 |
8.1.2 | 894 | 2/1/2024 |
8.1.2-preview-9 | 662 | 1/22/2024 |
8.1.2-preview-8 | 639 | 1/19/2024 |
8.1.2-preview-7 | 679 | 1/19/2024 |
8.1.2-preview-6 | 664 | 1/19/2024 |
8.1.2-preview-5 | 673 | 1/19/2024 |
8.1.2-preview-4 | 644 | 1/19/2024 |
8.1.2-preview-3 | 643 | 1/18/2024 |
8.1.2-preview-2 | 857 | 1/18/2024 |
8.1.2-preview-16 | 622 | 1/31/2024 |
8.1.2-preview-15 | 638 | 1/31/2024 |
8.1.2-preview-14 | 787 | 1/25/2024 |
8.1.2-preview-13 | 670 | 1/25/2024 |
8.1.2-preview-12 | 685 | 1/23/2024 |
8.1.2-preview-11 | 657 | 1/23/2024 |
8.1.2-preview-10 | 601 | 1/22/2024 |
8.1.2-preview-1 | 628 | 1/18/2024 |
8.1.1 | 861 | 1/18/2024 |
8.1.0 | 830 | 1/18/2024 |
8.0.3 | 936 | 12/29/2023 |
8.0.1 | 836 | 12/14/2023 |
8.0.0 | 1,039 | 12/7/2023 |
6.0.4.3 | 878 | 12/29/2023 |
6.0.4.2 | 885 | 12/20/2023 |
6.0.4.1 | 950 | 12/19/2023 |
6.0.4 | 990 | 12/4/2023 |
6.0.3.20 | 937 | 11/27/2023 |
6.0.3.19 | 937 | 11/22/2023 |