Wally.CleanArchitecture.Template 0.1.1391

There is a newer version of this package available.
See the version list below for details.
dotnet new install Wally.CleanArchitecture.Template::0.1.1391
                    
This package contains a .NET Template Package you can call from the shell/command line.

Wally.CleanArchitecture

[[TOC]]

ToDo

  1. Add AggregateRoot Shadow Properties or AuditableEntity abstract class for selected AggregateRoot and Entity:
public DateTime Created { get; set; }

public string? CreatedBy { get; set; }

public DateTime? LastModified { get; set; }

public string? LastModifiedBy { get; set; }
  1. ValueObject abstract base:

MSDN

public abstract class ValueObject
{
    protected static bool EqualOperator(ValueObject left, ValueObject right)
    {
        if (ReferenceEquals(left, null) ^ ReferenceEquals(right, null))
        {
            return false;
        }
        return ReferenceEquals(left, null) || left.Equals(right);
    }

    protected static bool NotEqualOperator(ValueObject left, ValueObject right)
    {
        return !(EqualOperator(left, right));
    }

    protected abstract IEnumerable<object> GetEqualityComponents();

    public override bool Equals(object obj)
    {
        if (obj == null || obj.GetType() != GetType())
        {
            return false;
        }

        var other = (ValueObject)obj;

        return this.GetEqualityComponents().SequenceEqual(other.GetEqualityComponents());
    }

    public override int GetHashCode()
    {
        return GetEqualityComponents()
            .Select(x => x != null ? x.GetHashCode() : 0)
            .Aggregate((x, y) => x ^ y);
    }
    // Other utility methods
}
  1. Create DependencyInjection class in Infrastructure

GitHub

  1. Use Aspect Oriented Programming

YouTube

Components

Swagger

UI: https://localhost:7197/swagger/index.html

Serilog

serilog.json

{
  "Serilog": {
    "Using": [
      "Serilog.Sinks.Console",
      "Serilog.Sinks.ApplicationInsights"
    ],
    "MinimumLevel": {
      "Default": "Debug",
      "Override": {
        "Microsoft": "Information"
      }
    },
    "WriteTo": [
      {
        "Name": "Debug"
      },
      {
        "Name": "Console",
        "Args": {
          "theme": "Serilog.Sinks.SystemConsole.Themes.AnsiConsoleTheme::Code, Serilog.Sinks.Console",
          "outputTemplate": "[{Timestamp:HH:mm:ss} {Level}] {SourceContext}{NewLine}{Message:lj}{NewLine}{Properties:j}{NewLine}{Exception}{NewLine}"
        }
      },
      {
        "Name": "ApplicationInsights",
        "Args": {
          "instrumentationKey": "---",
          "restrictedToMinimumLevel": "Information",
          "telemetryConverter": "Serilog.Sinks.ApplicationInsights.Sinks.ApplicationInsights.TelemetryConverters.TraceTelemetryConverter, Serilog.Sinks.ApplicationInsights"
        }
      },
      {
        "Name": "MSSqlServer",
        "Args": {
          "connectionString": "---",
          "tableName": "Log",
          "columnOptionsSection": {
            "addStandardColumns": [ "LogEvent" ],
            "removeStandardColumns": [ "Properties" ]
          }
        }
      }
    ],
    "Enrich": [
      "FromLogContext",
      "WithMachineName",
      "WithThreadId"
    ],
    "Properties": {
      "Application": "Wally.CleanArchitecture"
    }
  }
}

Health Checks

AppVer: https://localhost:7197 Health: https://localhost:7197/healthchecks

UI: https://localhost:7197/healthchecks-ui UI cfg: https://localhost:7197/healthchecks-api/ui-settings

API: https://localhost:7197/healthchecks-api

Webhooks: https://localhost:7197/healthchecks-webhooks

website

appsettings.json

...
  "HealthChecks-UI": {
    "DisableMigrations": true,
    "HealthChecks": [
      {
        "Name": "Poll Manager",
        "Uri": "/healthChecks"
      }
    ],
    "Webhooks": [
      {
        "Name": "",
        "Uri": "",
        "Payload": "",
        "RestoredPayload": ""
      }
    ],
    "EvaluationTimeOnSeconds": 10,
    "MinimumSecondsBetweenFailureNotifications": 60,
    "MaximumExecutionHistoriesPerEndpoint": 15,
    "HealthCheckDatabaseConnectionString": "Data Source=healthChecks"
  }
...

Known Issues:

Mapster

Known Issuees:

System.MissingMethodException: Constructor on type 'Mapster.EFCore.MapsterAsyncEnumerable`1[[Wally.CleanArchitecture.Contracts.Responses.Users.GetUserResponse, Wally.CleanArchitecture.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]' not found.
   at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture)
   at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at System.Activator.CreateInstance(Type type, Object[] args)
   at Mapster.EFCore.MapsterQueryableProvider.ExecuteAsync[TResult](Expression expression, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ExecuteAsync[TSource,TResult](MethodInfo operatorMethodInfo, IQueryable`1 source, Expression expression, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ExecuteAsync[TSource,TResult](MethodInfo operatorMethodInfo, IQueryable`1 source, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.SingleAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken)
   at Wally.CleanArchitecture.Persistence.Repository`1.GetAsync[TResult](Guid id, CancellationToken cancellationToken) in C:\repo\wally\wally.CleanArchitecture\src\Wally.CleanArchitecture.Persistence\Repository.cs:line 0
   at Wally.CleanArchitecture.Application.Users.Queries.GetUserQueryHandler.HandleAsync(GetUserQuery query, CancellationToken cancellationToken) in C:\repo\wally\wally.CleanArchitecture\src\Wally.CleanArchitecture.Application\Users\Queries\GetUserQueryHandler.cs:line 19
   at Wally.CleanArchitecture.Application.Abstractions.QueryHandler`2.Handle(TQuery query, CancellationToken cancellationToken) in C:\repo\wally\wally.CleanArchitecture\src\Wally.CleanArchitecture.Application\Abstractions\QueryHandler.cs:line 16
   at MediatR.Internal.RequestHandlerWrapperImpl`2.<>c__DisplayClass1_0.<Handle>g__Handler|0()
   at MediatR.Pipeline.RequestExceptionProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)

AutoMapper

WebSite

  • net6.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.3.3244 81 9/16/2025
1.3.3239 97 9/14/2025
1.3.3237 96 9/14/2025
1.3.3233 99 9/14/2025
1.3.3229 107 9/13/2025
1.3.3226 86 9/12/2025
1.3.3208 161 8/18/2025
1.3.3203 553 7/22/2025
1.3.3199 103 7/19/2025
1.3.3198 149 7/18/2025
1.3.3187 140 6/28/2025
1.3.3181 311 6/13/2025
1.3.3174 200 6/4/2025
1.3.3172 187 6/4/2025
1.3.3159 184 4/12/2025
1.3.3146 340 3/23/2025
1.3.3087 204 2/2/2025
1.3.3083 180 1/30/2025
1.3.3074 183 1/25/2025
1.3.3064 159 1/24/2025
1.3.3047 185 1/17/2025
1.3.3022 173 1/11/2025
1.3.2945 212 12/13/2024
1.3.2943 182 12/12/2024
1.3.2901 186 11/28/2024
1.3.2900 181 11/25/2024
1.3.2894 191 11/23/2024
1.3.2884 187 11/17/2024
1.3.2872 199 11/16/2024
1.3.2866 190 11/9/2024
1.3.2865 183 11/9/2024
1.3.2862 176 11/8/2024
1.3.2860 177 11/7/2024
1.3.2829 189 10/24/2024
1.3.2783 187 10/23/2024
1.3.2746 201 10/18/2024
1.3.2735 181 10/18/2024
1.3.2721 192 10/18/2024
1.3.2720 161 10/17/2024
1.3.2710 200 10/10/2024
1.3.2704 173 10/9/2024
1.3.2680 177 10/2/2024
1.3.2674 202 9/25/2024
1.3.2665 198 9/13/2024
1.3.2654 198 8/26/2024
1.3.2652 194 8/5/2024
1.3.2650 175 7/30/2024
1.3.2638 217 7/11/2024
1.3.2634 226 7/10/2024
1.3.2621 217 7/6/2024
1.3.2615 226 6/27/2024
1.3.2584 334 5/26/2024
1.3.2579 237 5/25/2024
1.3.2575 199 5/25/2024
1.3.2571 191 5/25/2024
1.3.2570 242 5/24/2024
1.3.2563 222 5/23/2024
1.3.2562 174 5/23/2024
1.3.2560 205 5/22/2024
1.3.2557 225 5/21/2024
1.3.2554 193 5/21/2024
1.3.2551 215 5/20/2024
1.3.2547 247 5/17/2024
1.3.2537 198 5/16/2024
1.3.2536 183 5/16/2024
1.3.2535 335 5/9/2024
1.3.2527 195 4/26/2024
1.3.2510 195 4/24/2024
1.3.2490 246 4/13/2024
1.3.2473 246 4/8/2024
1.3.2471 251 4/8/2024
1.3.2431 260 4/4/2024
1.3.2404 408 3/22/2024
1.3.2401 255 3/21/2024
1.3.2366 1,125 2/21/2024
1.3.2365 464 2/21/2024
1.3.2347 800 2/9/2024
1.3.2248 2,310 12/6/2023
1.3.2243 632 12/5/2023
1.3.2227 1,008 11/26/2023
1.3.2222 753 11/26/2023
1.3.2212 880 11/18/2023
1.3.2209 591 11/17/2023
1.3.2172 1,165 11/1/2023
1.3.2166 846 10/30/2023
1.3.2163 788 10/29/2023
1.3.2149 1,057 10/18/2023
1.3.2137 1,214 10/3/2023
1.3.2108 841 9/25/2023
1.3.2093 860 9/17/2023
1.3.2086 913 8/27/2023
1.3.2085 971 8/27/2023
1.3.2042 1,072 6/23/2023
1.3.2023 968 6/15/2023
1.3.1982 1,047 5/28/2023
1.3.1974 895 5/26/2023
1.3.1954 924 5/20/2023
1.3.1948 950 5/18/2023
1.3.1947 807 5/18/2023
1.3.1941 985 5/17/2023
1.3.1933 1,054 5/15/2023
1.3.1913 956 5/12/2023
1.3.1912 1,078 5/12/2023
1.3.1861 1,246 3/24/2023
1.3.1860 1,105 3/24/2023
1.3.1850 980 3/18/2023
1.3.1847 1,124 3/15/2023
1.3.1846 1,044 3/14/2023
1.3.1844 1,112 3/14/2023
1.3.1835 925 3/9/2023
1.3.1834 951 3/9/2023
1.3.1832 905 3/9/2023
1.3.1829 996 3/9/2023
1.3.1817 1,071 3/3/2023
1.2.1814 1,332 2/27/2023
1.2.1811 1,187 2/20/2023
1.2.1767 1,262 1/18/2023
1.2.1760 1,286 1/14/2023
1.2.1743 1,366 12/25/2022
1.2.1701 1,352 11/23/2022
1.2.1690 1,353 11/14/2022
1.2.1689 1,357 11/14/2022
1.2.1687 1,344 11/14/2022
1.2.1685 1,314 11/11/2022
1.2.8 1,330 11/1/2022
1.2.7 1,153 11/1/2022
1.2.6 1,387 11/1/2022
1.2.5 1,484 10/4/2022
1.2.4 1,473 9/9/2022
1.2.3 1,567 6/9/2022
1.2.2 1,397 6/9/2022
1.2.1 1,398 4/17/2022
1.2.0 1,565 4/17/2022
1.1.1553 1,512 6/10/2022
1.1.1516 1,356 4/17/2022
1.1.1515 1,566 4/17/2022
1.1.0 1,654 3/22/2022
0.1.1514 1,497 4/17/2022
0.1.1513 1,461 4/16/2022
0.1.1512 1,492 4/16/2022
0.1.1509 1,612 4/16/2022
0.1.1487 1,525 3/29/2022
0.1.1471 1,513 3/20/2022
0.1.1470 1,667 3/20/2022
0.1.1463 1,580 3/20/2022
0.1.1461 1,493 3/19/2022
0.1.1454 1,617 3/19/2022
0.1.1452 1,632 3/19/2022
0.1.1437 1,508 3/13/2022
0.1.1433 1,712 2/15/2022
0.1.1426 1,769 2/10/2022
0.1.1422 1,684 2/10/2022
0.1.1398 1,623 1/22/2022
0.1.1393 1,463 1/16/2022
0.1.1391 1,672 1/16/2022
0.1.1388 1,735 1/16/2022