<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Core features :: Juice&#39;s documentation</title>
    <link>https://docs.pavellis.com/core/index.html</link>
    <description>Logging&#xA;Configuration&#xA;Options&#xA;Swagger&#xA;Messaging&#xA;Observability (OpenTelemetry)&#xA;Mediator&#xA;Event bus&#xA;Entity framework&#xA;Integration services&#xA;xUnit&#xA;Multi-tenant&#xA;Modular</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Thu, 29 Oct 2026 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://docs.pavellis.com/core/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Overview</title>
      <link>https://docs.pavellis.com/core/overview/index.html</link>
      <pubDate>Sun, 02 Apr 2023 10:19:56 +0700</pubDate>
      <guid>https://docs.pavellis.com/core/overview/index.html</guid>
      <description>In this chapter, we will look at common components and extensions:&#xA;Logging Options Configuration Swagger MediatR Event bus Integration service Multi-tenant Audit XUnit Modular We implemented these extensions and services to resolved common problems that were specified in Application models section. To achieve more value out of this document, please go through .NET Microservices: Architecture for Containerized .NET Applications.&#xA;NOTE: Juice is currently in beta, so you must select the Include prerelease checkbox in the Nuget packages window to browse its packages.</description>
    </item>
    <item>
      <title>Logging</title>
      <link>https://docs.pavellis.com/core/logging/index.html</link>
      <pubDate>Mon, 03 Apr 2023 20:22:47 +0700</pubDate>
      <guid>https://docs.pavellis.com/core/logging/index.html</guid>
      <description>Versions&#xD;latest&#xD;7.0.2&#xD;There are many great logging frameworks for .Net Core like Log4Net, SeriLog, NLog… However, if you wish to customize logging system for special purpose, then you can inherit the LoggerProvider abstract class:</description>
    </item>
    <item>
      <title>Configuration</title>
      <link>https://docs.pavellis.com/core/configuration/index.html</link>
      <pubDate>Mon, 03 Apr 2023 20:23:10 +0700</pubDate>
      <guid>https://docs.pavellis.com/core/configuration/index.html</guid>
      <description>Per-tenant configuration If you are trying to develop a multi-tenant application, you may need to access the tenant configuration. So we provide ITenantsConfiguration interface to access tenant configuration and a default JSON configuration source that will read configuration from {ConfigurationDirectory}/tenants/{TenantIdentifier}/{FileName}.&#xA;public interface ITenantsConfiguration : IConfiguration { }&#xD;The ITenantsConfiguration is inherited from IConfiguration. So after registering the service on application startup you can inject it and use like IConfiguration.</description>
    </item>
    <item>
      <title>Options</title>
      <link>https://docs.pavellis.com/core/options/index.html</link>
      <pubDate>Mon, 03 Apr 2023 20:22:57 +0700</pubDate>
      <guid>https://docs.pavellis.com/core/options/index.html</guid>
      <description>Mutable Options To change options in the application, we can use IOptionsMutable&lt;T&gt; interface:&#xA;public interface IOptionsMutable&lt;out T&gt; : IOptionsSnapshot&lt;T&gt; where T : class, new() { // Update T field by field Task&lt;bool&gt; UpdateAsync(Action&lt;T&gt; applyChanges); }&#xD;To use IOptionsMutable&lt;T&gt; we must also register some required services.&#xA;... using Juice.Extensions.Options.DependencyInjection; ... // your changed options will be write to {WorkingDirectory}/appsettings.Development.json services.UseOptionsMutableFileStore(&#34;appsettings.Development.json&#34;); // OR separated appsettings file for strongly typed // services.UseOptionsMutableFileStore&lt;Options&gt;($&#34;appsettings.Separated.Development.json&#34;); // configure your Options class before use services.ConfigureMutable&lt;Options&gt;(configuration.GetSection(&#34;Options&#34;));&#xD;After that, we can inject IOptionsMutable&lt;Options&gt; and use it like IOptionsSnapshot&lt;Options&gt;. We can also call UpdateAsync method to update options.</description>
    </item>
    <item>
      <title>Swagger</title>
      <link>https://docs.pavellis.com/core/swagger/index.html</link>
      <pubDate>Mon, 03 Apr 2023 20:23:38 +0700</pubDate>
      <guid>https://docs.pavellis.com/core/swagger/index.html</guid>
      <description>Include XML comments This is a SwaggerGenOptions’ extension to include xml comments from referenced assemblies.&#xA;... using Juice.Extensions.Swagger; ... services.ConfigureSwaggerGen(c =&gt; { ... c.IncludeReferencedXmlComments(); });&#xD;The library can be accessed via Nuget:&#xA;Juice.AspNetCore SwaggerIgnoreFilter To ignore model properties from Swagger document generator but keep it in serialized JSON, we implement ApiIgnoreAttribute and ISchemaFilter interface to remove properties those have ApiIgnoreAttribute from OpenApiSchema</description>
    </item>
    <item>
      <title>Messaging</title>
      <link>https://docs.pavellis.com/core/messaging/index.html</link>
      <pubDate>Thu, 19 Feb 2026 00:00:00 +0000</pubDate>
      <guid>https://docs.pavellis.com/core/messaging/index.html</guid>
      <description>Juice v9 unifies all message types under a single IMessage hierarchy and introduces a MessagingBuilder entry point that composes the outbox, delivery, idempotency, and broker layers with a single services.AddMessaging() call.&#xA;IMessage Hierarchy Every message type in Juice v9 — MediatR commands, domain events, and integration events — implements IMessage, giving them a shared identity (MessageId, CreatedAt, TenantId).&#xA;IMessage&#xD;├── MessageId : Guid&#xD;├── CreatedAt : DateTimeOffset&#xD;└── TenantId : string?&#xD;IEvent : IMessage&#xD;└── EventName : string&#xD;IIntegrationEvent : IEvent ← required only on the CONSUMING side&#xD;└── (marker — enables dispatcher routing)&#xD;MessageBase (abstract record) : IMessage&#xD;└── MessageId = Guid.NewGuid(), CreatedAt = UtcNow (defaults)&#xD;IntegrationEvent (abstract record) : MessageBase, IIntegrationEvent&#xD;└── EventName → GetType().Name (default) ← optional to customizing the routing key on the PRODUCER side&#xD;Publish vs. Consume roles Role Type required Reason Publishing (outbox staging) Any IMessage Outbox accepts any message including plain domain events Consuming (broker dispatch) Must implement IIntegrationEvent IntegrationEventDispatcher uses EventName + type registry to deserialize and route from raw bytes Key insight: A plain domain event (IMessage) can be published and delivered through the outbox without ever implementing IIntegrationEvent if you do not want to customizing the event name. Only services that need to receive it via broker infrastructure must use IIntegrationEvent.</description>
    </item>
    <item>
      <title>Mediator</title>
      <link>https://docs.pavellis.com/core/mediator/index.html</link>
      <pubDate>Mon, 03 Apr 2023 20:23:50 +0700</pubDate>
      <guid>https://docs.pavellis.com/core/mediator/index.html</guid>
      <description>MediatR provides three in-process messaging patterns. In Juice v9 all three can extend MessageBase so every message carries MessageId, CreatedAt, and TenantId automatically.&#xA;Pattern Interface Handler interface Use when Request/Response IRequest&lt;TResponse&gt; IRequestHandler&lt;T, TResponse&gt; Command or query — exactly one handler, returns a result Notification INotification INotificationHandler&lt;T&gt; In-process fan-out — multiple handlers, no return value Stream Request IStreamRequest&lt;TResponse&gt; IStreamRequestHandler&lt;T, TResponse&gt; Async streaming — handler yields items one at a time NuGet Package Package Purpose MediatR Core MediatR library Juice.MediatR.Behaviors IdempotencyRequestBehavior&lt;,&gt;, TransactionBehavior&lt;,,&gt; Juice.MediatR.Contracts IIdempotentRequest interface Request / Response — Commands and Queries A request routes to exactly one handler and always returns a result. Use it for commands (state-changing operations) and queries (read-only operations).</description>
    </item>
    <item>
      <title>Event bus</title>
      <link>https://docs.pavellis.com/core/eventbus/index.html</link>
      <pubDate>Mon, 03 Apr 2023 20:23:59 +0700</pubDate>
      <guid>https://docs.pavellis.com/core/eventbus/index.html</guid>
      <description>ℹ v9 update This feature has been updated in Juice v9. See Messaging for the current API. The original v8.5.0 content is preserved here.&#xA;Versions&#xD;latest&#xD;7.x&#xD;To communicate between services we defined an IEventBus interface with a built-in RabbitMQ broker. Please follow up Implementing event-based communication between microservices for details.</description>
    </item>
    <item>
      <title>Entity framework</title>
      <link>https://docs.pavellis.com/core/entityframework/index.html</link>
      <pubDate>Tue, 11 Apr 2023 09:01:19 +0700</pubDate>
      <guid>https://docs.pavellis.com/core/entityframework/index.html</guid>
      <description>DbContextBase We resolved Audit, UnitOfWork and dynamic schema problems with an abstract DbContext that implemented these interfaces:&#xA;IAuditableDbContext IUnitOfWork IScehmaDbContext We’ll explain these interfaces below, but remember to call ConfigureServices( serviceProvider ) for your legacy DbContext in two ways:&#xA;Inside constructor // call inside constructor public TimerDbContext(IServiceProvider serviceProvider, DbContextOptions&lt;TimerDbContext&gt; options) : base(options) { ConfigureServices(serviceProvider); }&#xD;Or inside context factory if you are using pooled DbContext public class TimerDbContextScopedFactory : IDbContextFactory&lt;TimerDbContext&gt; { private readonly IDbContextFactory&lt;TimerDbContext&gt; _pooledFactory; private readonly IServiceProvider _serviceProvider; public TimerDbContextScopedFactory( IDbContextFactory&lt;TimerDbContext&gt; pooledFactory, IServiceProvider serviceProvider) { _pooledFactory = pooledFactory; _serviceProvider = serviceProvider; } public TimerDbContext CreateDbContext() { var context = _pooledFactory.CreateDbContext(); context.ConfigureServices(_serviceProvider); return context; } }&#xD;Then register PooledDbContext</description>
    </item>
    <item>
      <title>Integration service</title>
      <link>https://docs.pavellis.com/core/integration/index.html</link>
      <pubDate>Mon, 03 Apr 2023 20:24:09 +0700</pubDate>
      <guid>https://docs.pavellis.com/core/integration/index.html</guid>
      <description>ℹ v9 update This feature has been updated in Juice v9. See Messaging for the current API. The original v8.5.0 content is preserved here.&#xA;Integration event service In the IntegrationEventLog section, we talked about atomicity and resiliency when publishing to the event bus, followed by each step of the process. In this section, we will package the steps of publishing events and updating event states into IIntegrationEventService service, and then combine them with MediatR behavior for transaction processing.</description>
    </item>
    <item>
      <title>Observability (OpenTelemetry)</title>
      <link>https://docs.pavellis.com/core/observability/index.html</link>
      <pubDate>Thu, 29 Oct 2026 00:00:00 +0000</pubDate>
      <guid>https://docs.pavellis.com/core/observability/index.html</guid>
      <description>Overview Juice records distributed traces and framework metrics with the standard .NET APIs (System.Diagnostics.ActivitySource and Meter). The core packages do not reference OpenTelemetry: the application host decides whether to collect them, which exporters to use (OTLP, Jaeger, Azure Monitor…) and how to sample.&#xA;One request produces one connected trace, across processes:&#xA;TraceId = 4bf92f3577b34da6a3ce929d0e0e4736&#xD;POST /orders (ASP.NET Core server span, tagged with the Juice context)&#xD;└─ mediator PlaceOrder Juice.OpenTelemetry&#xD;└─ create OrderPlaced outbox save: the context is stored with the message&#xD;├─ deliver rabbitmq one per delivery attempt, possibly hours later&#xD;│ └─ send orders RabbitMQ / NATS producer&#xD;└─ process orders-queue consumer, in another service&#xD;└─ handle OrderPlacedHandler&#xD;The trace context travels in the standard W3C traceparent / tracestate message headers. It is separate from the MessageContext: x-correlation-id and x-causation-id keep their meaning and are copied onto the spans as tags.</description>
    </item>
    <item>
      <title>xUnit</title>
      <link>https://docs.pavellis.com/core/xunit/index.html</link>
      <pubDate>Mon, 03 Apr 2023 20:24:31 +0700</pubDate>
      <guid>https://docs.pavellis.com/core/xunit/index.html</guid>
      <description>Dependency Injection&#xA;Logging&#xA;Priority&#xA;CI-Ignore</description>
    </item>
    <item>
      <title>Multi-tenant</title>
      <link>https://docs.pavellis.com/core/multitenant/index.html</link>
      <pubDate>Mon, 03 Apr 2023 20:24:21 +0700</pubDate>
      <guid>https://docs.pavellis.com/core/multitenant/index.html</guid>
      <description>MultiTenant This core feature is useful to verify other core features that we have built because it is developed as a microservice. It’s integrated with Finbuckle to identity the tenant. We provide multiple choices for tenant data store:&#xA;File store EFCore store gRPC store We also provide the gRPC API to manage tenant information and tenant settings, so MultiTenant itself is a service with the full implementation of:&#xA;MultiTenant DBContext UnitOfWork pattern Audit gRPC API DDD/CQRS and Domain Events pattern Integration with event bus Per-tenant configuration/options xUnit helper To use multi-tenant, we must register services with Tenant type</description>
    </item>
    <item>
      <title>Modular</title>
      <link>https://docs.pavellis.com/core/modular/index.html</link>
      <pubDate>Fri, 14 Apr 2023 15:36:00 +0700</pubDate>
      <guid>https://docs.pavellis.com/core/modular/index.html</guid>
      <description>This small feature is useful for build a monolithic application from multiple separated features. Developers can register services and configure their modules by themselves.&#xA;Firstly, you need to implement the class that inherits from ModuleStartup for your features.&#xA;using Juice.Modular; ... namespace Juice.Test { [Feature(Required = true)] public class TestModuleStartup : ModuleStartup{ // override ConfigureServices public override void ConfigureServices(IServiceCollection services, IMvcBuilder mvc, IWebHostEnvironment env, IConfigurationRoot configuration) { // configure your services } // override Configure public override void Configure(IApplicationBuilder app, IEndpointRouteBuilder routes, IWebHostEnvironment env) { // configure application pipeline } // override OnShutdown public override void OnShutdown(IServiceProvider serviceProvider, IWebHostEnvironment env) { // release resources } } }&#xD;The Feature attribute’s arguments:</description>
    </item>
  </channel>
</rss>