QuickDBS.API 1.0.1.8

dotnet add package QuickDBS.API --version 1.0.1.8
NuGet\Install-Package QuickDBS.API -Version 1.0.1.8
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="QuickDBS.API" Version="1.0.1.8" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add QuickDBS.API --version 1.0.1.8
#r "nuget: QuickDBS.API, 1.0.1.8"
#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 QuickDBS.API as a Cake Addin
#addin nuget:?package=QuickDBS.API&version=1.0.1.8

// Install QuickDBS.API as a Cake Tool
#tool nuget:?package=QuickDBS.API&version=1.0.1.8

QuickDBS.API

A tiny library to generate Models and APIs from a supported QuickDBS database service. It imports all the Models from the table names of the selected database and generate Minimal APIs/Controllers there upon. <br/> <br/>

What's New

Now this library supports generating Minimal APIs using CreateMinimalAPIs method. <br/> <br/>

Required Libraries

You need to use one of the supported QuickDBS database packages in order to generate APIs. Currently, you can generate for SQLite, SQL Server and MySql databases for which the packages are already available on the NuGet. <br/> <br/>

Usage

Minimal APIs

  • Create an empty .NET 6.0 ASP.NET Core Web API project.

  • Remember to uncheck Use controllers (uncheck to use minimal APIs) checkbox.

  • Remove all code related to WeatherForecast API.

  • Add dependency from NuGet to QuickDBS.API and either QuickDBS.SQLite, QuickDBS.SQLServer or QuickDBS.MySQL.

  • Add using QuickDBS; to the Program.cs file.

  • Before var app = builder.Build(); line, add the following code:

      // Use SQLite or MySQL if that's what you want
      var db = new SQLServer("databasename");
    
      // Inject QuickDBS service for APIs
      builder.Services.AddSingleton<IQuickDBS>(db);
    
      // Create a LoggerFactory for logging from APIs
      builder.Services.AddSingleton<ILogger>(
              LoggerFactory.Create(b => b.AddConsole())
              .CreateLogger("QuickDBS_Minimal_Api"));
    
      // Remove the following line once APIs are generated.
      APIs.CreateMinimalAPIs(db);   
    
  • Run the project once so that the Models and the APIs are generated.

  • Remove or comment the APIs.CreateMinimalAPIs(db); line so that it doesn't keep on repeating the generation process.

  • After the app.UseHttpsRedirection(); line, add the following and resolve any namespace issues.

      app.UseQuickDBSApiEndPoints();
    
  • That's it. Now, you should have all the models in the Models folder and APIs in the APIs folder. Run the project and start using the Minimal APIs.


Controllers based APIs

  • Create an empty ASP.NET Core Web API project.

  • Add dependency from NuGet to QuickDBS.API and either QuickDBS.SQLite, QuickDBS.SQLServer or QuickDBS.MySQL.

  • Add using QuickDBS; to the Startup.cs file.

  • In the Startup.cs class, add the following in the ConfigureServices method

      // Use SQLite or MySQL if that's what you want
      var dbServer = new SQLServer("databasename");
    
      // Inject QuickDBS service for APIs
      services.AddSingleton<IQuickDBS>(dbServer);
    
      // Remove the following line once APIs are generated.
      APIs.Create(dbServer);   
    
  • Run the project once so that the Models, Controllers and the Web APIs are generated.

  • Remove or comment the APIs.Create(dbServer); line so that it doesn't keep on repeating the generation process.

  • That's it. Now, you should have all the models in the Models folder and controllers in the Controllers folder. Run the project and start using the Web APIs.

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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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.0.1.8 309 12/2/2021
1.0.1.7 292 11/16/2021
1.0.1.6 298 11/8/2021
1.0.1.4 323 11/6/2021
1.0.1.3 300 11/4/2021
1.0.0 302 11/2/2021