Ardalis CleanArchitecture & PackageAnalyzer

I have analyzed  https://github.com/ardalis/CleanArchitecture

Number projects : 7 (tests : 3, no tests : 4 )

Number packages : 172 (Outdated: 3, Deprecated: 0, Major version differs 7 )

Assembly with most references : Clean.Architecture.Core 21

    [Most public classes](pathname:///docs/Analysis/Clean.Architecture/summaryPublicClasses)

:Clean.Architecture.UseCases 12

Total Commits: 262 ( last commit : this year,2024 )

The commit with max files ( 257 ) is sha bc82b731d3caa1f05ebf316bd094c385dfa55e8d on 2022 May 06 )

The file with most commits ( 62 ) is D:\gth\CleanArchitecture\src\Clean.Architecture.Web\src/Clean.Architecture.Web/Clean.Architecture.Web.csproj

4 Projects

diagram

7 Packages with major version different

Nr ID References Projects
1 Microsoft.Bcl.AsyncInterfaces *(References: 2)* **Major differs** 6.0.0 Clean.Architecture.Web,Clean.Architecture.Infrastructure,Clean.Architecture.FunctionalTests
1.1.1 Clean.Architecture.IntegrationTests
2 System.Configuration.ConfigurationManager *(References: 2)* **Major differs** 6.0.1 Clean.Architecture.Web,Clean.Architecture.Infrastructure,Clean.Architecture.FunctionalTests,Clean.Architecture.IntegrationTests
4.4.0 Clean.Architecture.UnitTests
3 System.Diagnostics.DiagnosticSource *(References: 2)* **Major differs** 8.0.0 Clean.Architecture.Web,Clean.Architecture.FunctionalTests,Clean.Architecture.IntegrationTests
6.0.1 Clean.Architecture.Infrastructure
4 System.Diagnostics.EventLog *(References: 2)* **Major differs** 8.0.0 Clean.Architecture.FunctionalTests,Clean.Architecture.IntegrationTests
6.0.0 Clean.Architecture.UnitTests
5 System.IO.Pipelines *(References: 2)* **Major differs** 6.0.3 Clean.Architecture.Web,Clean.Architecture.Infrastructure
8.0.0 Clean.Architecture.FunctionalTests,Clean.Architecture.IntegrationTests
6 System.Reflection.Metadata *(References: 2)* **Major differs** 6.0.1 Clean.Architecture.Web,Clean.Architecture.Infrastructure,Clean.Architecture.FunctionalTests
1.6.0 Clean.Architecture.IntegrationTests,Clean.Architecture.UnitTests
7 System.Security.Cryptography.ProtectedData *(References: 2)* **Major differs** 6.0.0 Clean.Architecture.Web,Clean.Architecture.Infrastructure,Clean.Architecture.FunctionalTests,Clean.Architecture.IntegrationTests
4.4.0 Clean.Architecture.UnitTests

Summary of project public classes

Assemblies with number of public classes

diagram

Assemblies with Public methods

diagram

Classes with Public methods

diagram

Lines summary

Assemblies with most lines in public classses

diagram

Public Classes with most lines

diagram

Public Methods with most lines

diagram

References between projects

Assemblies with References

diagram

Classes with References

diagram

Commits

Commits per year

diagram

Most Commits per file

(Most commits 62 , median 2 )

diagram

Nr Number commits Name Full Path
1 62 Clean.Architecture.Web.csproj D:\gth\CleanArchitecture\src\Clean.Architecture.Web\src/Clean.Architecture.Web/Clean.Architecture.Web.csproj
2 55 Clean.Architecture.Infrastructure.csproj D:\gth\CleanArchitecture\src\Clean.Architecture.Infrastructure\src/Clean.Architecture.Infrastructure/Clean.Architecture.Infrastructure.csproj
3 41 Clean.Architecture.FunctionalTests.csproj D:\gth\CleanArchitecture\tests\Clean.Architecture.FunctionalTests\tests/Clean.Architecture.FunctionalTests/Clean.Architecture.FunctionalTests.csproj
4 40 Clean.Architecture.IntegrationTests.csproj D:\gth\CleanArchitecture\tests\Clean.Architecture.IntegrationTests\tests/Clean.Architecture.IntegrationTests/Clean.Architecture.IntegrationTests.csproj
5 35 Clean.Architecture.UnitTests.csproj D:\gth\CleanArchitecture\tests\Clean.Architecture.UnitTests\tests/Clean.Architecture.UnitTests/Clean.Architecture.UnitTests.csproj
6 28 Clean.Architecture.Core.csproj D:\gth\CleanArchitecture\src\Clean.Architecture.Core\src/Clean.Architecture.Core/Clean.Architecture.Core.csproj
7 16 Program.cs D:\gth\CleanArchitecture\src\Clean.Architecture.Web\src/Clean.Architecture.Web/Program.cs
8 15 CustomWebApplicationFactory.cs D:\gth\CleanArchitecture\tests\Clean.Architecture.FunctionalTests\tests/Clean.Architecture.FunctionalTests/CustomWebApplicationFactory.cs
9 14 DefaultInfrastructureModule.cs D:\gth\CleanArchitecture\src\Clean.Architecture.Infrastructure\src/Clean.Architecture.Infrastructure/DefaultInfrastructureModule.cs
10 13 AppDbContext.cs D:\gth\CleanArchitecture\src\Clean.Architecture.Infrastructure\src/Clean.Architecture.Infrastructure/Data/AppDbContext.cs
11 11 ToDoItemSearchService.cs D:\gth\CleanArchitecture\src\Clean.Architecture.Core\src/Clean.Architecture.Core/Services/ToDoItemSearchService.cs

Commits with most files per year

diagram

Nr SHA Date NrFiles
1 d87414d0845126afc326e280838a300e06966c10 2024 Mar 04 17
2 6e0742b79a5137a52fbf4b809898b2e2cedaf563 2023 Aug 28 72
3 bc82b731d3caa1f05ebf316bd094c385dfa55e8d 2022 May 06 257
4 6e4f23e999ebb555b2dd342b9dc9bf5698243652 2021 Apr 17 49
5 8698ae4d2008b0f4465ff54b8434f812f5ed066f 2020 Dec 09 237

### Commits with max files

diagram

Nr SHA Date NrFiles
1 bc82b731d3caa1f05ebf316bd094c385dfa55e8d 2022 May 06 257
2 8698ae4d2008b0f4465ff54b8434f812f5ed066f 2020 Dec 09 237
3 6e0742b79a5137a52fbf4b809898b2e2cedaf563 2023 Aug 28 72
4 dfeb7cb4741b85bc22b1505b0c534f73f578f674 2023 Dec 14 60
5 6e4f23e999ebb555b2dd342b9dc9bf5698243652 2021 Apr 17 49
6 8b33e4fcf1152884bafe6e4153db8b0393b8d26d 2020 Dec 02 38
7 fff4ae6540a7ccde87ef21af6521fd6dbcb4056a 2021 Oct 24 33
8 9019ebb9e1567eaa46074e93d9e8c2029083bfe9 2021 Nov 12 32
9 999bdf93c4448859f5a03c7e1a5715cb8e8727f4 2021 Nov 12 30
10 6e0742b79a5137a52fbf4b809898b2e2cedaf563 2023 Aug 28 23
11 d87414d0845126afc326e280838a300e06966c10 2024 Mar 04 17
12 08d78725d4838dcea2de78b35002a3735c86efd5 2022 Nov 16 17

danpdc cleanArchitectureTemplate & Package Analyzer

I have analyzed  https://github.com/danpdc/cleanArchitectureTemplate

 

Number projects : 5 (tests : 0, no tests : 5 )

Number packages : 86 (Outdated: 9, Deprecated: 0, Major version differs 2 )

Assembly with most references : Physicube.Application 103

Most public classes :Physicube.Application 36

Total Commits: 5 ( last commit : this year,2024 )

The commit with max files ( 28 ) is sha cefd7c6c9a4b13b88b6e92fb238ebff6c1fbe2e1 on 2024 September 15 )

The file with most commits ( 1 ) is D:\gth\cleanArchitectureTemplate\Physicube.Application\Physicube.Application/Abstractions/DataAbstractions/IActivityRepository.cs

5 Projects

diagram

2 Packages with major version different

Nr ID References Projects
1 Microsoft.IdentityModel.Protocols *(References: 2)* **Major differs** 6.24.0 Physiqube.Infrastructure.Data
7.1.2 Physiqube.API
2 Microsoft.IdentityModel.Protocols.OpenIdConnect *(References: 2)* **Major differs** 6.24.0 Physiqube.Infrastructure.Data
7.1.2 Physiqube.API

Summary of project public classes

Assemblies with number of public classes

diagram

Assemblies with Public methods

diagram

Classes with Public methods

diagram

Lines summary

Assemblies with most lines in public classses

diagram

Public Classes with most lines

diagram

Public Methods with most lines

diagram

References between projects

Assemblies with References

diagram

Classes with References

diagram

Commits

Commits per year

diagram

Most Commits per file

(Most commits 1 , median 1 )

diagram

Nr Number commits Name Full Path
1 1 IActivityRepository.cs D:\gth\cleanArchitectureTemplate\Physicube.Application\Physicube.Application/Abstractions/DataAbstractions/IActivityRepository.cs
2 1 IAthleteRepository.cs D:\gth\cleanArchitectureTemplate\Physicube.Application\Physicube.Application/Abstractions/DataAbstractions/IAthleteRepository.cs
3 1 IUnitOfWork.cs D:\gth\cleanArchitectureTemplate\Physicube.Application\Physicube.Application/Abstractions/DataAbstractions/IUnitOfWork.cs
4 1 ActivityLog.cs D:\gth\cleanArchitectureTemplate\Physicube.Application\Physicube.Application/Activities/ActivityLog.cs
5 1 CyclingActivity.cs D:\gth\cleanArchitectureTemplate\Physicube.Application\Physicube.Application/Activities/Cycling/CyclingActivity.cs
6 1 GetRides.cs D:\gth\cleanArchitectureTemplate\Physicube.Application\Physicube.Application/Activities/Cycling/GetRides.cs
7 1 LogCyclingActivity.cs D:\gth\cleanArchitectureTemplate\Physicube.Application\Physicube.Application/Activities/Cycling/LogCyclingActivity.cs
8 1 GetActivityLog.cs D:\gth\cleanArchitectureTemplate\Physicube.Application\Physicube.Application/Activities/GetActivityLog.cs
9 1 GetRunningActivities.cs D:\gth\cleanArchitectureTemplate\Physicube.Application\Physicube.Application/Activities/Running/GetRunningActivities.cs
10 1 LogRunningActivity.cs D:\gth\cleanArchitectureTemplate\Physicube.Application\Physicube.Application/Activities/Running/LogRunningActivity.cs
11 1 RunningActivity.cs D:\gth\cleanArchitectureTemplate\Physicube.Application\Physicube.Application/Activities/Running/RunningActivity.cs
12 1 GetWalkingActivities.cs D:\gth\cleanArchitectureTemplate\Physicube.Application\Physicube.Application/Activities/Walking/GetWalkingActivities.cs
13 1 LogWalkingActivity.cs D:\gth\cleanArchitectureTemplate\Physicube.Application\Physicube.Application/Activities/Walking/LogWalkingActivity.cs
14 1 WalkingActivity.cs D:\gth\cleanArchitectureTemplate\Physicube.Application\Physicube.Application/Activities/Walking/WalkingActivity.cs
15 1 ChangeAthleteBasicInfo.cs D:\gth\cleanArchitectureTemplate\Physicube.Application\Physicube.Application/Athletes/ChangeAthleteBasicInfo.cs
16 1 ChangeAthleteBodyInfo.cs D:\gth\cleanArchitectureTemplate\Physicube.Application\Physicube.Application/Athletes/ChangeAthleteBodyInfo.cs
17 1 ChangeAthleteLocation.cs D:\gth\cleanArchitectureTemplate\Physicube.Application\Physicube.Application/Athletes/ChangeAthleteLocation.cs
18 1 DisplayAthleteProfile.cs D:\gth\cleanArchitectureTemplate\Physicube.Application\Physicube.Application/Athletes/DisplayAthleteProfile.cs
19 1 ServiceCollectionExtensions.cs D:\gth\cleanArchitectureTemplate\Physicube.Application\Physicube.Application/Extensions/ServiceCollectionExtensions.cs
20 1 CurrentAthlete.cs D:\gth\cleanArchitectureTemplate\Physicube.Application\Physicube.Application/Identity/CurrentAthlete.cs

Commits with most files per year

diagram

Nr SHA Date NrFiles
1 cefd7c6c9a4b13b88b6e92fb238ebff6c1fbe2e1 2024 Sep 15 28

### Commits with max files

diagram

Nr SHA Date NrFiles
1 cefd7c6c9a4b13b88b6e92fb238ebff6c1fbe2e1 2024 Sep 15 28
2 cefd7c6c9a4b13b88b6e92fb238ebff6c1fbe2e1 2024 Sep 15 19
3 cefd7c6c9a4b13b88b6e92fb238ebff6c1fbe2e1 2024 Sep 15 12
4 cefd7c6c9a4b13b88b6e92fb238ebff6c1fbe2e1 2024 Sep 15 12
5 cefd7c6c9a4b13b88b6e92fb238ebff6c1fbe2e1 2024 Sep 15 8

Generated by https://www.nuget.org/packages/NetPackageAnalyzerConsole

Rafaelfgx Architecture and PackageAnalyzer

I have analyzed https://github.com/rafaelfgx/Architecture .

Number projects : 5 (tests : 0, no tests : 5 )

Number packages : 119 (Outdated: 0, Deprecated: 0, Major version differs 9 )

Total Commits: 5 ( last commit : this year,2024 )

The commit with max files ( 85 ) is sha bf6edda5dad1cba410c7814f5d6fb373f5b7c29c on 2024 July 21 )

The file with most commits ( 1 ) is D:\gth\Architecture\source\Application\source/Application/Architecture.Application.csproj

:::

5 Projects

 

diagram

9 Packages with major version different

 

Nr ID References Projects
1 Microsoft.Bcl.AsyncInterfaces *(References: 2)* **Major differs** 1.1.1 Architecture.Application,Architecture.Web
6.0.0 Architecture.Database
2 Microsoft.IdentityModel.Abstractions *(References: 2)* **Major differs** 8.0.0 Architecture.Application,Architecture.Web
6.35.0 Architecture.Database
3 Microsoft.IdentityModel.JsonWebTokens *(References: 2)* **Major differs** 8.0.0 Architecture.Application,Architecture.Web
6.35.0 Architecture.Database
4 Microsoft.IdentityModel.Logging *(References: 2)* **Major differs** 8.0.0 Architecture.Application,Architecture.Web
6.35.0 Architecture.Database
5 Microsoft.IdentityModel.Protocols *(References: 2)* **Major differs** 6.35.0 Architecture.Application,Architecture.Database
7.1.2 Architecture.Web
6 Microsoft.IdentityModel.Protocols.OpenIdConnect *(References: 2)* **Major differs** 6.35.0 Architecture.Application,Architecture.Database
7.1.2 Architecture.Web
7 Microsoft.IdentityModel.Tokens *(References: 2)* **Major differs** 8.0.0 Architecture.Application,Architecture.Web
6.35.0 Architecture.Database
8 System.Diagnostics.DiagnosticSource *(References: 2)* **Major differs** 6.0.1 Architecture.Application,Architecture.Database
8.0.0 Architecture.Web
9 System.IdentityModel.Tokens.Jwt *(References: 2)* **Major differs** 8.0.0 Architecture.Application,Architecture.Web
6.35.0 Architecture.Database

Commits

 

Commits per year

 

diagram

Most Commits per file

 

(Most commits 1 , median 1 )

 

diagram

Nr Number commits Name Full Path
1 1 Architecture.Application.csproj D:\gth\Architecture\source\Application\source/Application/Architecture.Application.csproj
2 1 AuthHandler.cs D:\gth\Architecture\source\Application\source/Application/Auth/AuthHandler.cs
3 1 AuthRequest.cs D:\gth\Architecture\source\Application\source/Application/Auth/AuthRequest.cs
4 1 AuthRequestValidator.cs D:\gth\Architecture\source\Application\source/Application/Auth/AuthRequestValidator.cs
5 1 AuthResponse.cs D:\gth\Architecture\source\Application\source/Application/Auth/AuthResponse.cs
6 1 AddExampleHandler.cs D:\gth\Architecture\source\Application\source/Application/Example/Add/AddExampleHandler.cs
7 1 AddExampleRequest.cs D:\gth\Architecture\source\Application\source/Application/Example/Add/AddExampleRequest.cs
8 1 AddExampleRequestValidator.cs D:\gth\Architecture\source\Application\source/Application/Example/Add/AddExampleRequestValidator.cs
9 1 DeleteExampleHandler.cs D:\gth\Architecture\source\Application\source/Application/Example/Delete/DeleteExampleHandler.cs
10 1 DeleteExampleRequest.cs D:\gth\Architecture\source\Application\source/Application/Example/Delete/DeleteExampleRequest.cs
11 1 DeleteExampleRequestValidator.cs D:\gth\Architecture\source\Application\source/Application/Example/Delete/DeleteExampleRequestValidator.cs
12 1 GetExampleHandler.cs D:\gth\Architecture\source\Application\source/Application/Example/Get/GetExampleHandler.cs
13 1 GetExampleRequest.cs D:\gth\Architecture\source\Application\source/Application/Example/Get/GetExampleRequest.cs
14 1 GetExampleRequestValidator.cs D:\gth\Architecture\source\Application\source/Application/Example/Get/GetExampleRequestValidator.cs
15 1 GridExampleHandler.cs D:\gth\Architecture\source\Application\source/Application/Example/Grid/GridExampleHandler.cs
16 1 GridExampleRequest.cs D:\gth\Architecture\source\Application\source/Application/Example/Grid/GridExampleRequest.cs
17 1 GridExampleRequestValidator.cs D:\gth\Architecture\source\Application\source/Application/Example/Grid/GridExampleRequestValidator.cs
18 1 ListExampleHandler.cs D:\gth\Architecture\source\Application\source/Application/Example/List/ListExampleHandler.cs
19 1 ListExampleRequest.cs D:\gth\Architecture\source\Application\source/Application/Example/List/ListExampleRequest.cs
20 1 UpdateExampleHandler.cs D:\gth\Architecture\source\Application\source/Application/Example/Update/UpdateExampleHandler.cs

Commits with most files per year

 

diagram

Nr SHA Date NrFiles
1 bf6edda5dad1cba410c7814f5d6fb373f5b7c29c 2024 Jul 21 85

### Commits with max files

diagram

Nr SHA Date NrFiles
1 bf6edda5dad1cba410c7814f5d6fb373f5b7c29c 2024 Jul 21 85
2 bf6edda5dad1cba410c7814f5d6fb373f5b7c29c 2024 Jul 21 49
3 bf6edda5dad1cba410c7814f5d6fb373f5b7c29c 2024 Jul 21 16
4 bf6edda5dad1cba410c7814f5d6fb373f5b7c29c 2024 Jul 21 6
5 bf6edda5dad1cba410c7814f5d6fb373f5b7c29c 2024 Jul 21 3

Generated by https://www.nuget.org/packages/NetPackageAnalyzerConsole

Friday links 479

  1. Common design patterns at Stripe – DEV Community
  2. Look ma, no Dockerfile! – Publishing containers with the .NET SDK | The blog of a software developer and tester.
  3. New Tab
  4. The Developer’s Guide to SSO — WorkOS
  5. microsoft/generative-ai-for-beginners: 18 Lessons, Get Started Building with Generative AI https://microsoft.github.io/generative-ai-for-beginners/
  6. Marcus’ Blog
  7. ✨ 6 website learning gems you should visit! – DEV Community
  8. Don’t Refactor Like Uncle Bob. Please – Axol’s Blog
  9. Azure OpenAI On Your Data with Semantic Kernel | Semantic Kernel
  10. (1) Milan Jovanović on X: “Here are 9 excellent libraries I use in my projects: 1. MediatR 2. Polly 3. EF Core 4. Refit 5. Testcontainers 6. MassTransit 7. Marten 8. xUnit 9. Dapper Which library would you add to the list? — Subscribe to my weekly newsletter to accelerate your .NET https://t.co/FZe01JbyKJ” / X
  11. Add Non-Production Endpoints in ASP.NET Application
  12. Programmatically monitoring and reacting to resource logs in .NET Aspire
  13. dotnet/Docker.DotNet: :whale: .NET (C#) Client Library for Docker API
  14. Must-have resources for new .NET Aspire developers
  15. Programmatically elevate a .NET application on any platform
  16. Highlight Elements During Testing | Better world by better software
  17. williamtroup/JsonTree.js: A lightweight JavaScript library that generates customizable tree views to better visualize JSON data.
  18. Good Practices | RSCG Examples
  19. 20 Patterns to Master Dynamic Programming
  20. AnandChowdhary/calendar-link: Calendar link generator for popular services

RSCG – Sera.Union

RSCG – Sera.Union
 
 

name Sera.Union
nuget https://www.nuget.org/packages/Sera.Union/
link https://github.com/sera-net/Sera.Union
author Sera

Generate tagged union

 

This is how you can use Sera.Union .

The code that you start with is


<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net8.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
  </PropertyGroup>

	<PropertyGroup>
		<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
		<CompilerGeneratedFilesOutputPath>$(BaseIntermediateOutputPath)\GX</CompilerGeneratedFilesOutputPath>
	</PropertyGroup>

	<ItemGroup>
	  <PackageReference Include="Sera.Union" Version="0.7.0" />
	</ItemGroup>

</Project>


The code that you will use is


using UnionTypesDemo;

Console.WriteLine("Save or not");
var data = SaveToDatabase.Save(0);
Console.WriteLine(data.IsNotFound);
data = SaveToDatabase.Save(1);
if(data.IsOk)
{
    Console.WriteLine(data.Tag);
    Console.WriteLine(data.Ok);
}


 

The code that is generated is

// <auto-generated/>

#nullable enable

using Sera.TaggedUnion;

namespace UnionTypesDemo {

public partial struct ResultSave
    : global::Sera.TaggedUnion.ITaggedUnion
    , global::System.IEquatable<ResultSave>
    , global::System.IComparable<ResultSave>
#if NET7_0_OR_GREATER
    , global::System.Numerics.IEqualityOperators<ResultSave, ResultSave, bool>
    , global::System.Numerics.IComparisonOperators<ResultSave, ResultSave, bool>
#endif
{
    private __impl_ _impl;
    private ResultSave(__impl_ _impl) { this._impl = _impl; }

    public readonly Tags Tag
    {
        [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
        get => this._impl._tag;
    }

    public enum Tags : byte
    {
        Ok = 1,
        NotFound = 2,
    }

    [global::System.Runtime.CompilerServices.CompilerGenerated]
    private struct __impl_
    {
        public __unmanaged_ _unmanaged_;
        public readonly Tags _tag;

        [global::System.Runtime.CompilerServices.CompilerGenerated]
        [global::System.Runtime.InteropServices.StructLayout(global::System.Runtime.InteropServices.LayoutKind.Explicit)]
        internal struct __unmanaged_
        {
            [global::System.Runtime.InteropServices.FieldOffset(0)]
            public int _0;
        }

        public __impl_(Tags _tag)
        {
            global::System.Runtime.CompilerServices.Unsafe.SkipInit(out this._unmanaged_);
            this._tag = _tag;
        }
    }

    [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
    public static ResultSave MakeOk(int value)
    {
        var _impl = new __impl_(Tags.Ok);
        _impl._unmanaged_._0 = value;
        return new ResultSave(_impl);
    }
    [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
    public static ResultSave MakeNotFound()
    {
        var _impl = new __impl_(Tags.NotFound);
        return new ResultSave(_impl);
    }

    public readonly bool IsOk
    {
        [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
        get => this._impl._tag == Tags.Ok;
    }
    public readonly bool IsNotFound
    {
        [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
        get => this._impl._tag == Tags.NotFound;
    }

    public int Ok
    {
        [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
        readonly get => !this.IsOk ? default! : this._impl._unmanaged_._0!;
        [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
        set { if (this.IsOk) { this._impl._unmanaged_._0 = value; } }
    }

    [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
    public readonly bool Equals(ResultSave other) => this.Tag != other.Tag ? false : this.Tag switch
    {
        Tags.Ok => global::System.Collections.Generic.EqualityComparer<int>.Default.Equals(this.Ok, other.Ok),
        _ => true,
    };

    [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
    public readonly override int GetHashCode() => this.Tag switch
    {
        Tags.Ok => global::System.HashCode.Combine(this.Tag, this.Ok),
        _ => global::System.HashCode.Combine(this.Tag),
    };

    [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
    public readonly override bool Equals(object? obj) => obj is ResultSave other && Equals(other);

    [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
    public static bool operator ==(ResultSave left, ResultSave right) => Equals(left, right);
    [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
    public static bool operator !=(ResultSave left, ResultSave right) => !Equals(left, right);

    [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
    public readonly int CompareTo(ResultSave other) => this.Tag != other.Tag ? global::System.Collections.Generic.Comparer<Tags>.Default.Compare(this.Tag, other.Tag) : this.Tag switch
    {
        Tags.Ok => global::System.Collections.Generic.Comparer<int>.Default.Compare(this.Ok, other.Ok),
        _ => 0,
    };

    [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
    public static bool operator <(ResultSave left, ResultSave right) => left.CompareTo(right) < 0;
    [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
    public static bool operator >(ResultSave left, ResultSave right) => left.CompareTo(right) > 0;
    [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
    public static bool operator <=(ResultSave left, ResultSave right) => left.CompareTo(right) <= 0;
    [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
    public static bool operator >=(ResultSave left, ResultSave right) => left.CompareTo(right) >= 0;

    [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
    public readonly override string ToString() => this.Tag switch
    {
        Tags.Ok => $"{nameof(ResultSave)}.{nameof(Tags.Ok)} {{ {this.Ok} }}",
        Tags.NotFound => $"{nameof(ResultSave)}.{nameof(Tags.NotFound)}",
        _ => nameof(ResultSave),
    };
}

} // namespace UnionTypesDemo

Code and pdf at

https://ignatandrei.github.io/RSCG_Examples/v2/docs/Sera.Union

RSCG – RSCG_NameGenerator

RSCG – RSCG_NameGenerator
 
 

name RSCG_NameGenerator
nuget https://www.nuget.org/packages/RSCG_NameGenerator/
link https://github.com/ignatandrei/NameGenerator/
author Andrei Ignat

Generating unique names for assemblies

 

This is how you can use RSCG_NameGenerator .

The code that you start with is


<Project Sdk="Microsoft.NET.Sdk">

	<PropertyGroup>
	
		<OutputType>Exe</OutputType>
		<TargetFramework>net8.0</TargetFramework>
		<ImplicitUsings>enable</ImplicitUsings>
		<Nullable>enable</Nullable>
	</PropertyGroup>

	<ItemGroup>
		<PackageReference Include="RSCG_NameGenerator" Version="2024.26.8.2002" >
			<OutputItemType>Analyzer</OutputItemType>
			<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
		</PackageReference>
	</ItemGroup>
	<PropertyGroup>
		<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
		<CompilerGeneratedFilesOutputPath>$(BaseIntermediateOutputPath)\GX</CompilerGeneratedFilesOutputPath>
	</PropertyGroup>
</Project>


The code that you will use is


using Generated.TestNameGenerator;
//by just putting here
//you will not deploy the dll when you deploy the project
//name are generated in the code source
Console.WriteLine($"Name:{TheAssemblyInfo.GeneratedName}");
Console.WriteLine($"Nice:{TheAssemblyInfo.GeneratedNameNice}");
Console.WriteLine($"Small:{TheAssemblyInfo.GeneratedNameSmall}");
//if you want to generate a new name every time you run the app
//put in the csproj
//<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
//but the dll will be deployed with the app
//Console.WriteLine(NameGenerator.NameGeneratorData.Generate().UniqueNameLong);

 

The code that is generated is


                // <auto-generated/>
                namespace Generated.TestNameGenerator
                {
                    public static class TheAssemblyInfo
                    {
                        public const string AssemblyName = "TestNameGenerator";
                        public const string GeneratedNameNice = "Sir Winston Churchill is feeling private in Naypyidaw";
                        public const string GeneratedNameSmall = "private-Sir Winston Churchill";
                        public const string GeneratedName = "private-Sir Winston Churchill-Naypyidaw";
                        
                    }
                }

Code and pdf at

https://ignatandrei.github.io/RSCG_Examples/v2/docs/RSCG_NameGenerator

{ADCES] Discutii si Networking

Details

Timp de discutii / networking / profesional / neprofesional.

Va invitam pe toti

Tuesday, September 24, 2024
7:30 PM to 9:30 PM EEST

Add to calendar

<?XML:NAMESPACE PREFIX = “[default] http://www.w3.org/2000/svg” NS = “http://www.w3.org/2000/svg” />

Quantic Pub

Șoseaua Grozăvești 82 · București

How to find us

Quantic Pub. Telefon personal 0728200034

RSCG – Coplt.Dropping

RSCG – Coplt.Dropping
 
 

name Coplt.Dropping
nuget https://www.nuget.org/packages/Coplt.Dropping/
link https://github.com/2A5F/Coplt.Dropping
author 2A5F

Generating disposable

 

This is how you can use Coplt.Dropping .

The code that you start with is


<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net8.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
  </PropertyGroup>
	 <PropertyGroup>
        <EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
        <CompilerGeneratedFilesOutputPath>$(BaseIntermediateOutputPath)\GX</CompilerGeneratedFilesOutputPath>
    </PropertyGroup>
	 <ItemGroup>
	   <PackageReference Include="Coplt.Dropping" Version="0.5.1" OutputItemType="Analyzer" />
	   
	 </ItemGroup>

</Project>


The code that you will use is


using IDisposableGeneratorDemo;
//https://github.com/benutomo-dev/RoslynComponents
using (var db = new DALDB())
{
    Console.WriteLine("before releasing");
}
Console.WriteLine("after releasing");


using Coplt.Dropping;

namespace IDisposableGeneratorDemo;

[Dropping]
partial class DALDB :IDisposable
{
    private ConnectionDB cn;
    private ConnectionDB cn1;

    public DALDB()
    {
        cn = new ConnectionDB();
        cn1=new ConnectionDB();
    }
    [Drop]
    public void Drop()
    {
        cn.Dispose();
        cn1.Dispose();
    }
}



namespace IDisposableGeneratorDemo;

class ConnectionDB : IDisposable
{
    public void Dispose()
    {
        Console.WriteLine("disposing connectiondb");
    }
}


 

The code that is generated is

// <auto-generated/>

#nullable enable

using Coplt.Dropping;

namespace IDisposableGeneratorDemo {

internal partial class DALDB : global::System.IDisposable
{

    protected virtual void Dispose(bool disposing)
    {
        if (disposing) Drop();
    }

    public void Dispose()
    {
        Dispose(true);
        GC.SuppressFinalize(this);
    }

    ~DALDB()
    {
        Dispose(false);
    }

}

} // namespace IDisposableGeneratorDemo

Code and pdf at

https://ignatandrei.github.io/RSCG_Examples/v2/docs/Coplt.Dropping

Andrei Ignat weekly software news(mostly .NET)

* indicates required

Please select all the ways you would like to hear from me:

You can unsubscribe at any time by clicking the link in the footer of our emails. For information about our privacy practices, please visit our website.

We use Mailchimp as our marketing platform. By clicking below to subscribe, you acknowledge that your information will be transferred to Mailchimp for processing. Learn more about Mailchimp's privacy practices here.