GenericDataLayer_Ggt 1.0.9
dotnet add package GenericDataLayer_Ggt --version 1.0.9
NuGet\Install-Package GenericDataLayer_Ggt -Version 1.0.9
<PackageReference Include="GenericDataLayer_Ggt" Version="1.0.9" />
paket add GenericDataLayer_Ggt --version 1.0.9
#r "nuget: GenericDataLayer_Ggt, 1.0.9"
// Install GenericDataLayer_Ggt as a Cake Addin #addin nuget:?package=GenericDataLayer_Ggt&version=1.0.9 // Install GenericDataLayer_Ggt as a Cake Tool #tool nuget:?package=GenericDataLayer_Ggt&version=1.0.9
About the Package:-
A generic layer for .Net, wrapping ADO.NET functionality in multiple functions which accepts SQL parameters and queries to perform CRUD operations on Microsoft SQL Server Database. Inject into a caller class and just call the methods and pass SQL parameters along with the query string and the method will return results. All methods are in async-await fashion.
Usage:-
Add in service collection as a singleton in ConfigureService Method of your Startup Class
services.AddSingleton<IDataLayer, DataLayer>(ServiceProvider=>
{
return new DataLayer(Configuration, "Your ConnectionString Name from appsettings.json");
});
The object in appsettings should look like this:
"connectionStrings": {
"ConnectionName": "your connectionstring"
}
Add as DI in constructor :-
IDataLayer dal;
your_class(IDataLayer _dal)
{
dal=_dal;
}
Use where you need like this:-
await dal.GeneralNonQuery(string Query); Please Not that Exceptions are not being handled on this layer, you should use ExceptionHandling middleware for centralizing exception handling.
Important Points:-
In ReadSingle(), method, the value parameter should be exactly the same as the column name which is returning the result.
In Generic Methods , T should be class, not struct.
Product | Versions 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.1 is compatible. |
-
.NETCoreApp 3.1
- FastMember (>= 1.5.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 5.0.0)
- System.Data.SqlClient (>= 4.8.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Methods summary added