SaltFramework 1.1.0

dotnet add package SaltFramework --version 1.1.0
                    
NuGet\Install-Package SaltFramework -Version 1.1.0
                    
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="SaltFramework" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SaltFramework" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="SaltFramework" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SaltFramework --version 1.1.0
                    
#r "nuget: SaltFramework, 1.1.0"
                    
#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.
#addin nuget:?package=SaltFramework&version=1.1.0
                    
Install SaltFramework as a Cake Addin
#tool nuget:?package=SaltFramework&version=1.1.0
                    
Install SaltFramework as a Cake Tool

You can do all the CRUD operation using this library.

Just follow the step.

Step 1: Create Repository class for your operation (e.g: AccountRepository) just inherit from RepositoryBase Class shown as below

public class AccountRepository : RepositoryBase<AccountModel> {

} Step 2: Create DbContext class and inherit from DbContext (Entity Framework)

public class RepositoryContext: DbContext { public RepositoryContext(DbContextOptions options):base(options) {

} }

Step 3: Pass the context class in the constructor of Repository class shown as below.

public class AccountRepository : RepositoryBase<Account> { public AccountRepository(RepositoryContext repositoryContext) : base(repositoryContext) { } } note: Here <Account> is a DTO class

Step 4: Provide dependency injection in startup.cs

public void ConfigureServices(IServiceCollection services) { services.AddTransient<AccountRepository>(); }

Step 5: Just use your operation on controller shown as below

[Route("api/[controller]")] public class AccountController : BaseController { private readonly AccountRepository _accountRepository; public AccountController(AccountRepository accountRepository) { this._accountRepository = accountRepository; }

[HttpPost] [Route("user")] public IActionResult ValidateUser([FromBody]Account account) { var data = _accountRepository.FindByCondition(x ⇒ x.UserName == account.UserName && x.Password == account.Password).FirstOrDefault(); } public ActionResult AddAccount([FromBody]Account account) { _accountRepository.Create(account); _accountRepository.Save(); } }

Benefit of using this library:

  1. You don't have to create separate repository for every operation.
  2. Code is reduced by just injecting the Repository class.
  3. Clean code
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.1 is compatible.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.1.0 585 7/15/2019
1.0.0 498 7/15/2019