From 2f79fc952652036f8cd69415a50a4643486a5e58 Mon Sep 17 00:00:00 2001 From: Adrian Frielinghaus Date: Mon, 14 Oct 2024 17:49:08 +0200 Subject: [PATCH] no message --- .../Blauhaus.ClientActors.Abstractions.csproj | 7 +++--- .../IActor.cs | 9 +++++++ .../IActorContainer.cs | 1 - .../IClientEntity.cs | 13 ++++++++++ .../IDtoLoader.cs | 15 ++++++++++++ .../IDtoModelActor.cs | 10 ++++++++ .../IEntity.cs | 24 +++++++++++++++++++ .../IModelActor.cs | 10 ++++++++ .../IModelActorContainer.cs | 1 - .../ActorContainerMockBuilder.cs | 1 - .../BaseModelActorMockBuilder.cs | 1 - .../Blauhaus.ClientActors.TestHelpers.csproj | 2 +- .../Extensions/MockContainerExtensions.cs | 1 - .../ModelActorContainerMockBuilder.cs | 1 - .../.Base/BaseActorTest.cs | 8 +++---- .../.Base/BaseDtoModelActorTest.cs | 2 +- .../Blauhaus.ClientActors.Tests.csproj | 11 +++++---- .../Suts/ITestActor.cs | 2 +- .../Suts/ITestDtoLoader.cs | 2 +- .../Suts/ITestModelActor.cs | 2 +- .../Suts/TestBaseActor.cs | 2 +- .../Suts/TestDto.cs | 2 +- .../.Ioc/ServiceCollectionExtensions.cs | 1 - .../Actors/BaseDtoModelActor.cs | 3 --- .../Actors/BaseIdActor.cs | 1 - .../Actors/BaseModelActor.cs | 1 - .../Blauhaus.ClientActors.csproj | 4 ---- .../Containers/ActorContainer.cs | 9 +++---- .../Containers/ModelActorContainer.cs | 5 +--- 29 files changed, 104 insertions(+), 47 deletions(-) create mode 100644 src/Blauhaus.ClientActors.Abstractions/IActor.cs create mode 100644 src/Blauhaus.ClientActors.Abstractions/IClientEntity.cs create mode 100644 src/Blauhaus.ClientActors.Abstractions/IDtoLoader.cs create mode 100644 src/Blauhaus.ClientActors.Abstractions/IDtoModelActor.cs create mode 100644 src/Blauhaus.ClientActors.Abstractions/IEntity.cs create mode 100644 src/Blauhaus.ClientActors.Abstractions/IModelActor.cs diff --git a/src/Blauhaus.ClientActors.Abstractions/Blauhaus.ClientActors.Abstractions.csproj b/src/Blauhaus.ClientActors.Abstractions/Blauhaus.ClientActors.Abstractions.csproj index 2ca9609..759848b 100644 --- a/src/Blauhaus.ClientActors.Abstractions/Blauhaus.ClientActors.Abstractions.csproj +++ b/src/Blauhaus.ClientActors.Abstractions/Blauhaus.ClientActors.Abstractions.csproj @@ -7,11 +7,10 @@ - - + - - + + diff --git a/src/Blauhaus.ClientActors.Abstractions/IActor.cs b/src/Blauhaus.ClientActors.Abstractions/IActor.cs new file mode 100644 index 0000000..7868573 --- /dev/null +++ b/src/Blauhaus.ClientActors.Abstractions/IActor.cs @@ -0,0 +1,9 @@ +using System; +using Blauhaus.Common.Abstractions; + +namespace Blauhaus.ClientActors.Abstractions; + +public interface IActor : IAsyncDisposable, IAsyncInitializable, IAsyncReloadable, IHasId +{ + +} \ No newline at end of file diff --git a/src/Blauhaus.ClientActors.Abstractions/IActorContainer.cs b/src/Blauhaus.ClientActors.Abstractions/IActorContainer.cs index 1452424..69d5f7d 100644 --- a/src/Blauhaus.ClientActors.Abstractions/IActorContainer.cs +++ b/src/Blauhaus.ClientActors.Abstractions/IActorContainer.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; -using Blauhaus.Domain.Abstractions.Actors; namespace Blauhaus.ClientActors.Abstractions { diff --git a/src/Blauhaus.ClientActors.Abstractions/IClientEntity.cs b/src/Blauhaus.ClientActors.Abstractions/IClientEntity.cs new file mode 100644 index 0000000..a25006f --- /dev/null +++ b/src/Blauhaus.ClientActors.Abstractions/IClientEntity.cs @@ -0,0 +1,13 @@ +using System; +using Blauhaus.Domain.Abstractions.Entities; + +namespace Blauhaus.ClientActors.Abstractions; + +public interface IClientEntity : IEntity +{ + long ModifiedAtTicks { get; } +} + +public interface IClientEntity : IClientEntity +{ +} \ No newline at end of file diff --git a/src/Blauhaus.ClientActors.Abstractions/IDtoLoader.cs b/src/Blauhaus.ClientActors.Abstractions/IDtoLoader.cs new file mode 100644 index 0000000..d8b258c --- /dev/null +++ b/src/Blauhaus.ClientActors.Abstractions/IDtoLoader.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Blauhaus.Common.Abstractions; + +namespace Blauhaus.ClientActors.Abstractions; + +public interface IDtoLoader : IAsyncPublisher + where TDto : class, IHasId + where TId : IEquatable +{ + Task GetOneAsync(TId id); + Task TryGetOneAsync(TId id); + Task> GetAllAsync(); +} \ No newline at end of file diff --git a/src/Blauhaus.ClientActors.Abstractions/IDtoModelActor.cs b/src/Blauhaus.ClientActors.Abstractions/IDtoModelActor.cs new file mode 100644 index 0000000..e169a91 --- /dev/null +++ b/src/Blauhaus.ClientActors.Abstractions/IDtoModelActor.cs @@ -0,0 +1,10 @@ +using System.Threading.Tasks; +using Blauhaus.Common.Abstractions; + +namespace Blauhaus.ClientActors.Abstractions; + +public interface IDtoModelActor : IModelActor + where TModel : IHasId +{ + Task GetDtoAsync(); +} \ No newline at end of file diff --git a/src/Blauhaus.ClientActors.Abstractions/IEntity.cs b/src/Blauhaus.ClientActors.Abstractions/IEntity.cs new file mode 100644 index 0000000..c3b1353 --- /dev/null +++ b/src/Blauhaus.ClientActors.Abstractions/IEntity.cs @@ -0,0 +1,24 @@ +using Blauhaus.Common.Abstractions; +using System; + +namespace Blauhaus.Domain.Abstractions.Entities +{ + public interface IEntity : IHasId + { + EntityState EntityState { get; } + } + + public interface IEntity: IEntity + { + + } + +} + +public enum EntityState +{ + Active, + Draft, + Archived, + Deleted +} \ No newline at end of file diff --git a/src/Blauhaus.ClientActors.Abstractions/IModelActor.cs b/src/Blauhaus.ClientActors.Abstractions/IModelActor.cs new file mode 100644 index 0000000..03a7224 --- /dev/null +++ b/src/Blauhaus.ClientActors.Abstractions/IModelActor.cs @@ -0,0 +1,10 @@ +using System.Threading.Tasks; +using Blauhaus.Common.Abstractions; + +namespace Blauhaus.ClientActors.Abstractions; + +public interface IModelActor : IActor, IAsyncPublisher + where TModel : IHasId +{ + Task GetModelAsync(); +} \ No newline at end of file diff --git a/src/Blauhaus.ClientActors.Abstractions/IModelActorContainer.cs b/src/Blauhaus.ClientActors.Abstractions/IModelActorContainer.cs index 469ac2f..4b8fe92 100644 --- a/src/Blauhaus.ClientActors.Abstractions/IModelActorContainer.cs +++ b/src/Blauhaus.ClientActors.Abstractions/IModelActorContainer.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.Threading.Tasks; using Blauhaus.Common.Abstractions; -using Blauhaus.Domain.Abstractions.Actors; namespace Blauhaus.ClientActors.Abstractions { diff --git a/src/Blauhaus.ClientActors.TestHelpers/ActorContainerMockBuilder.cs b/src/Blauhaus.ClientActors.TestHelpers/ActorContainerMockBuilder.cs index 2b8fe1b..6510992 100644 --- a/src/Blauhaus.ClientActors.TestHelpers/ActorContainerMockBuilder.cs +++ b/src/Blauhaus.ClientActors.TestHelpers/ActorContainerMockBuilder.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.Linq; using Blauhaus.ClientActors.Abstractions; -using Blauhaus.Domain.Abstractions.Actors; using Blauhaus.TestHelpers.MockBuilders; using Moq; diff --git a/src/Blauhaus.ClientActors.TestHelpers/BaseModelActorMockBuilder.cs b/src/Blauhaus.ClientActors.TestHelpers/BaseModelActorMockBuilder.cs index 0840102..5f923e2 100644 --- a/src/Blauhaus.ClientActors.TestHelpers/BaseModelActorMockBuilder.cs +++ b/src/Blauhaus.ClientActors.TestHelpers/BaseModelActorMockBuilder.cs @@ -2,7 +2,6 @@ using Blauhaus.ClientActors.Abstractions; using Blauhaus.Common.Abstractions; using Blauhaus.Common.TestHelpers.MockBuilders; -using Blauhaus.Domain.Abstractions.Actors; using Moq; namespace Blauhaus.ClientActors.TestHelpers diff --git a/src/Blauhaus.ClientActors.TestHelpers/Blauhaus.ClientActors.TestHelpers.csproj b/src/Blauhaus.ClientActors.TestHelpers/Blauhaus.ClientActors.TestHelpers.csproj index adef123..df892fa 100644 --- a/src/Blauhaus.ClientActors.TestHelpers/Blauhaus.ClientActors.TestHelpers.csproj +++ b/src/Blauhaus.ClientActors.TestHelpers/Blauhaus.ClientActors.TestHelpers.csproj @@ -5,7 +5,7 @@ - + diff --git a/src/Blauhaus.ClientActors.TestHelpers/Extensions/MockContainerExtensions.cs b/src/Blauhaus.ClientActors.TestHelpers/Extensions/MockContainerExtensions.cs index 8ccd726..a9d8ea5 100644 --- a/src/Blauhaus.ClientActors.TestHelpers/Extensions/MockContainerExtensions.cs +++ b/src/Blauhaus.ClientActors.TestHelpers/Extensions/MockContainerExtensions.cs @@ -1,7 +1,6 @@ using System; using Blauhaus.ClientActors.Abstractions; using Blauhaus.Common.Abstractions; -using Blauhaus.Domain.Abstractions.Actors; using Blauhaus.TestHelpers; namespace Blauhaus.ClientActors.TestHelpers.Extensions diff --git a/src/Blauhaus.ClientActors.TestHelpers/ModelActorContainerMockBuilder.cs b/src/Blauhaus.ClientActors.TestHelpers/ModelActorContainerMockBuilder.cs index 35dd7ba..20b0614 100644 --- a/src/Blauhaus.ClientActors.TestHelpers/ModelActorContainerMockBuilder.cs +++ b/src/Blauhaus.ClientActors.TestHelpers/ModelActorContainerMockBuilder.cs @@ -3,7 +3,6 @@ using System.Threading.Tasks; using Blauhaus.ClientActors.Abstractions; using Blauhaus.Common.Abstractions; -using Blauhaus.Domain.Abstractions.Actors; using Blauhaus.TestHelpers.Builders.Base; using Moq; diff --git a/src/Blauhaus.ClientActors.Tests/.Base/BaseActorTest.cs b/src/Blauhaus.ClientActors.Tests/.Base/BaseActorTest.cs index 7a8ffa6..802b948 100644 --- a/src/Blauhaus.ClientActors.Tests/.Base/BaseActorTest.cs +++ b/src/Blauhaus.ClientActors.Tests/.Base/BaseActorTest.cs @@ -1,10 +1,9 @@ -using Blauhaus.Analytics.Abstractions; -using Blauhaus.Analytics.Abstractions.Service; -using Blauhaus.Analytics.TestHelpers.MockBuilders; +using Blauhaus.Analytics.TestHelpers.MockBuilders; using Blauhaus.Ioc.Abstractions; using Blauhaus.Ioc.DotNetCoreIocService; using Blauhaus.TestHelpers.BaseTests; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; using NUnit.Framework; namespace Blauhaus.ClientActors.Tests.Base @@ -17,10 +16,9 @@ public virtual void Setup() base.Cleanup(); Services.AddSingleton(); + Services.AddLogging(x => x.AddDebug()); - AddService(x => MockLogger.Object); } - protected AnalyticsLoggerMockBuilder MockLogger => AddMock, IAnalyticsLogger>().Invoke(); } } \ No newline at end of file diff --git a/src/Blauhaus.ClientActors.Tests/Actors/DtoModelActorTests/.Base/BaseDtoModelActorTest.cs b/src/Blauhaus.ClientActors.Tests/Actors/DtoModelActorTests/.Base/BaseDtoModelActorTest.cs index 9476853..f4ee818 100644 --- a/src/Blauhaus.ClientActors.Tests/Actors/DtoModelActorTests/.Base/BaseDtoModelActorTest.cs +++ b/src/Blauhaus.ClientActors.Tests/Actors/DtoModelActorTests/.Base/BaseDtoModelActorTest.cs @@ -2,8 +2,8 @@ using Blauhaus.ClientActors.Tests.Suts; using Microsoft.Extensions.DependencyInjection; using System; -using Moq; using Blauhaus.ClientActors.Tests.Mocks; +using Moq; namespace Blauhaus.ClientActors.Tests.Actors.DtoModelActorTests.Base { diff --git a/src/Blauhaus.ClientActors.Tests/Blauhaus.ClientActors.Tests.csproj b/src/Blauhaus.ClientActors.Tests/Blauhaus.ClientActors.Tests.csproj index 6df1efc..d0451e4 100644 --- a/src/Blauhaus.ClientActors.Tests/Blauhaus.ClientActors.Tests.csproj +++ b/src/Blauhaus.ClientActors.Tests/Blauhaus.ClientActors.Tests.csproj @@ -14,11 +14,12 @@ - - - - - + + + + + + diff --git a/src/Blauhaus.ClientActors.Tests/Suts/ITestActor.cs b/src/Blauhaus.ClientActors.Tests/Suts/ITestActor.cs index 00a05dd..348946c 100644 --- a/src/Blauhaus.ClientActors.Tests/Suts/ITestActor.cs +++ b/src/Blauhaus.ClientActors.Tests/Suts/ITestActor.cs @@ -1,4 +1,4 @@ -using Blauhaus.Domain.Abstractions.Actors; +using Blauhaus.ClientActors.Abstractions; namespace Blauhaus.ClientActors.Tests.Suts { diff --git a/src/Blauhaus.ClientActors.Tests/Suts/ITestDtoLoader.cs b/src/Blauhaus.ClientActors.Tests/Suts/ITestDtoLoader.cs index 127df4b..072bdaa 100644 --- a/src/Blauhaus.ClientActors.Tests/Suts/ITestDtoLoader.cs +++ b/src/Blauhaus.ClientActors.Tests/Suts/ITestDtoLoader.cs @@ -1,5 +1,5 @@ using System; -using Blauhaus.Domain.Abstractions.DtoCaches; +using Blauhaus.ClientActors.Abstractions; namespace Blauhaus.ClientActors.Tests.Suts { diff --git a/src/Blauhaus.ClientActors.Tests/Suts/ITestModelActor.cs b/src/Blauhaus.ClientActors.Tests/Suts/ITestModelActor.cs index 0da1f55..1279845 100644 --- a/src/Blauhaus.ClientActors.Tests/Suts/ITestModelActor.cs +++ b/src/Blauhaus.ClientActors.Tests/Suts/ITestModelActor.cs @@ -1,5 +1,5 @@ using System; -using Blauhaus.Domain.Abstractions.Actors; +using Blauhaus.ClientActors.Abstractions; namespace Blauhaus.ClientActors.Tests.Suts { diff --git a/src/Blauhaus.ClientActors.Tests/Suts/TestBaseActor.cs b/src/Blauhaus.ClientActors.Tests/Suts/TestBaseActor.cs index c27febc..c699647 100644 --- a/src/Blauhaus.ClientActors.Tests/Suts/TestBaseActor.cs +++ b/src/Blauhaus.ClientActors.Tests/Suts/TestBaseActor.cs @@ -2,8 +2,8 @@ using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; +using Blauhaus.ClientActors.Abstractions; using Blauhaus.ClientActors.Actors; -using Blauhaus.Domain.Abstractions.Actors; namespace Blauhaus.ClientActors.Tests.Suts { diff --git a/src/Blauhaus.ClientActors.Tests/Suts/TestDto.cs b/src/Blauhaus.ClientActors.Tests/Suts/TestDto.cs index 45527ed..3bf1ab3 100644 --- a/src/Blauhaus.ClientActors.Tests/Suts/TestDto.cs +++ b/src/Blauhaus.ClientActors.Tests/Suts/TestDto.cs @@ -1,5 +1,5 @@ using System; -using Blauhaus.Domain.Abstractions.Entities; +using Blauhaus.ClientActors.Abstractions; namespace Blauhaus.ClientActors.Tests.Suts { diff --git a/src/Blauhaus.ClientActors/.Ioc/ServiceCollectionExtensions.cs b/src/Blauhaus.ClientActors/.Ioc/ServiceCollectionExtensions.cs index 6e894b1..d92092a 100644 --- a/src/Blauhaus.ClientActors/.Ioc/ServiceCollectionExtensions.cs +++ b/src/Blauhaus.ClientActors/.Ioc/ServiceCollectionExtensions.cs @@ -1,7 +1,6 @@ using Blauhaus.ClientActors.Abstractions; using Blauhaus.ClientActors.Containers; using Blauhaus.Common.Abstractions; -using Blauhaus.Domain.Abstractions.Actors; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; diff --git a/src/Blauhaus.ClientActors/Actors/BaseDtoModelActor.cs b/src/Blauhaus.ClientActors/Actors/BaseDtoModelActor.cs index e9f1851..2cf374b 100644 --- a/src/Blauhaus.ClientActors/Actors/BaseDtoModelActor.cs +++ b/src/Blauhaus.ClientActors/Actors/BaseDtoModelActor.cs @@ -2,9 +2,6 @@ using System.Threading.Tasks; using Blauhaus.ClientActors.Abstractions; using Blauhaus.Common.Abstractions; -using Blauhaus.Common.Utils.Disposables; -using Blauhaus.Domain.Abstractions.Actors; -using Blauhaus.Domain.Abstractions.DtoCaches; namespace Blauhaus.ClientActors.Actors { diff --git a/src/Blauhaus.ClientActors/Actors/BaseIdActor.cs b/src/Blauhaus.ClientActors/Actors/BaseIdActor.cs index 44d1ddc..a72a2f9 100644 --- a/src/Blauhaus.ClientActors/Actors/BaseIdActor.cs +++ b/src/Blauhaus.ClientActors/Actors/BaseIdActor.cs @@ -1,7 +1,6 @@ using System; using System.Threading.Tasks; using Blauhaus.ClientActors.Abstractions; -using Blauhaus.Domain.Abstractions.Actors; namespace Blauhaus.ClientActors.Actors { diff --git a/src/Blauhaus.ClientActors/Actors/BaseModelActor.cs b/src/Blauhaus.ClientActors/Actors/BaseModelActor.cs index f5f1b88..53d647b 100644 --- a/src/Blauhaus.ClientActors/Actors/BaseModelActor.cs +++ b/src/Blauhaus.ClientActors/Actors/BaseModelActor.cs @@ -2,7 +2,6 @@ using System.Threading.Tasks; using Blauhaus.ClientActors.Abstractions; using Blauhaus.Common.Abstractions; -using Blauhaus.Domain.Abstractions.Actors; namespace Blauhaus.ClientActors.Actors { diff --git a/src/Blauhaus.ClientActors/Blauhaus.ClientActors.csproj b/src/Blauhaus.ClientActors/Blauhaus.ClientActors.csproj index 1777077..a67ad22 100644 --- a/src/Blauhaus.ClientActors/Blauhaus.ClientActors.csproj +++ b/src/Blauhaus.ClientActors/Blauhaus.ClientActors.csproj @@ -11,10 +11,6 @@ - - - - diff --git a/src/Blauhaus.ClientActors/Containers/ActorContainer.cs b/src/Blauhaus.ClientActors/Containers/ActorContainer.cs index 4b915a7..166522b 100644 --- a/src/Blauhaus.ClientActors/Containers/ActorContainer.cs +++ b/src/Blauhaus.ClientActors/Containers/ActorContainer.cs @@ -2,11 +2,8 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -using Blauhaus.Analytics.Abstractions; -using Blauhaus.Analytics.Abstractions.Service; using Blauhaus.ClientActors.Abstractions; using Blauhaus.ClientActors.Actors; -using Blauhaus.Domain.Abstractions.Actors; using Blauhaus.Ioc.Abstractions; using Microsoft.Extensions.Logging; using Winton.Extensions.Threading.Actor; @@ -16,7 +13,7 @@ namespace Blauhaus.ClientActors.Containers public class ActorContainer : BaseActorContainer where TActor : class, IActor { public ActorContainer( - IAnalyticsLogger> logger, + ILogger> logger, IServiceLocator serviceLocator) : base(logger, serviceLocator) { @@ -27,11 +24,11 @@ public abstract class BaseActorContainer : BaseActor, IActorContain where TActor : class, IActor { private readonly IServiceLocator _serviceLocator; - protected readonly IAnalyticsLogger Logger; + protected readonly ILogger Logger; private readonly Dictionary _actorCache = new(); protected BaseActorContainer( - IAnalyticsLogger logger, + ILogger logger, IServiceLocator serviceLocator) { _serviceLocator = serviceLocator; diff --git a/src/Blauhaus.ClientActors/Containers/ModelActorContainer.cs b/src/Blauhaus.ClientActors/Containers/ModelActorContainer.cs index 4597172..33b24fe 100644 --- a/src/Blauhaus.ClientActors/Containers/ModelActorContainer.cs +++ b/src/Blauhaus.ClientActors/Containers/ModelActorContainer.cs @@ -1,12 +1,9 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; -using Blauhaus.Analytics.Abstractions; -using Blauhaus.Analytics.Abstractions.Service; using Blauhaus.ClientActors.Abstractions; using Blauhaus.Common.Abstractions; using Blauhaus.Common.Utils.Disposables; -using Blauhaus.Domain.Abstractions.Actors; using Blauhaus.Ioc.Abstractions; using Microsoft.Extensions.Logging; @@ -20,7 +17,7 @@ public class ModelActorContainer : BaseActorContainer _activeModelSubscriptions = new(); public ModelActorContainer( - IAnalyticsLogger> logger, + ILogger> logger, IServiceLocator serviceLocator) : base(logger, serviceLocator) {