Crusaders.Framework 1.0.2

Additional Details

This package only support net472. Later version support netstandard for netCoreApp and net472.

There is a newer version of this package available.
See the version list below for details.
dotnet add package Crusaders.Framework --version 1.0.2                
NuGet\Install-Package Crusaders.Framework -Version 1.0.2                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Crusaders.Framework" Version="1.0.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Crusaders.Framework --version 1.0.2                
#r "nuget: Crusaders.Framework, 1.0.2"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Crusaders.Framework as a Cake Addin
#addin nuget:?package=Crusaders.Framework&version=1.0.2

// Install Crusaders.Framework as a Cake Tool
#tool nuget:?package=Crusaders.Framework&version=1.0.2                

Crusaders Framework

.Net Framework 4.7.2

Welcome to Crusaders base repo. Here you should find all common features to extend in clients project, whether its Net2.0, AspNet web app or PC WPF apps

Build and Publish

Pipeline: src → scaffold Demo/Local Db → Build → Test → Pack → Publish

  • Publish:

    • nuget - dll/Client api services
    • Azure deploy - ASP
    • ClickOnce - WinApp
  • Run publish script to generate nuget AFTER update <Version> in .csproj

  • TODO: CI pipeline is not setup, must run publish script locally on merged branch

Scaffold Db

  • Run script to re-generate metadata after SQL alter.
  • Check Database section for more info

Nuget publisher

Tools EnvironmentVar PATH
msbuild %ProgramFiles%\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin
mstest, dotnet test %ProgramFiles%\Microsoft Visual Studio\2022\Community\Common7\IDE

Database

EF Core Framework for .NetFramework (< v4.0)

You should download and setup localhost SQL server, then Run setup scripts in folder.

Read more about EF core operation use in this repo here.

Features

Logging

To use this feature, one must have FrameworkDbHash setup. This should point to Crusaders.Framework catalog in the destination DB. AutoMapper supported.

Currently log:

  • System message/errors (need code to trigger manually)
  • Filter exception/error
  • Incoming/Outgoing traffic

Service integration

using Crusaders.Framework.Integration;

Internal services
Install nuget package for Crusaders.API.`Client`.Services
private readonly ICrdApiClient<IService> _serviceClient;
public ImgSpoofingCommandHandler(ICrdApiClient<IService> serviceClient) { // Something }
// Can override Method name if not Get/Post
_serviceClient.Get((x, param) => x.Get(param), request);
_serviceClient.Post((x, param) => x.Post(param), request);
_serviceClient.Call((x, param) => x.MethodA(param), request, "MethodA");
External web service
public ImgSpoofingCommandHandler(IOutgoingCommandHandler pingCommandHandler) { // Something }
pingCommandHandler.Execute(new OutgoingPostCommand
{
    Uri = $"{ImgSpoofingConfig.Hostname}/bg-ping",
    //Timeout = 20,
});

Test framework

Unit test

Because Crusaders framewoek proj dont include client override implementation, please select unit test type that best match your current project

  • CrdUnitTest<IHandler>: Use this to quickly test implementation of a service/handler. Be careful this only install default component and not intended to be use at Client project
  • CrdServiceUnitTest<IHandler, 'Client'.ApiConfiguration>: Use this in client API project to quickly test implementation of a service/handler

Integration test (beta)

  • This can be use to have test that call multiple DbContext/handler, and can perform mock remote service call (invoke the controller without hosting)
  • Check ExceptionFilterBaseTest.cs for example
Product Compatible and additional computed target framework versions.
.NET Framework net472 is compatible.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Crusaders.Framework:

Package Downloads
Crusaders.API.Vstar.Bg.Services

Vstar API that implements Crusaders framework. Public services only.

GitHub repositories

This package is not used by any popular GitHub repositories.