OS Data Access Library
A Data Access Library built using the light weight ORM Dapper created by Stack-Overflow.
For the purposed of the project the following was implmented :
- Data Services
- Data Models
For this 3 Class and assocaiated Interfacaes was Implemented
- SQL Data Acesss (In the case of our project the DB of Choice was an Azure MQ Sql Server Database) The connection string for this called comes from the appconfig file of the project that is utilising the data access library.This class can be copeid and altered with a an inteface implementaion for a variety of database by changing some minor immplemenations and references to the type of database desired. Thus allowing the project to grow an evolve, For the purpose of the project the following crud operations were implmented
- Load A List of Generic Type T allowing for the passing of dynamic parameters utilising stored procedures
- Get a single Object of Generic Type T allowing for the passing of dynamic parameters utilsing stored procedures
- Saving Data Using a inline sql statement, passing a list of paraeteres
- Saving Data using a stored procedure with an object as a parameters for the stored procedure.
- Delete of Data using a stored procedure allowing for the passing of a list of parameteres.
- Returning a string value based on inline sql statement, allowing for the passing of a list of parameters
- Returning a intger value based on inline sql statement, allowing for the passing of a list of parameters
- Returnning an non modelled dataset using an inline sql statement , allowing for the passing of a list of parameters
- Login Data A class for handling secure login to the application and the database using passwords and authentication.
- Data Access Class which consists of 8 methods for handling CRUD operations outlined the SQL Data Access class and being implemented by the use of dependency injection in the various parts of the other projects
For this project the various models expected to be returned from stored procuders were defined in the model folder. These models can be added or altered as required to suit the program.
Please see associated repository OS Book Review Web API
Please see associated repository OS Book Review .NET MAUI App
Please see associated repository OS Book Review Tests
Tim Coery Dapper Tutorial on Data Access Layer Tim Coery Youtube video
Dapper Website Learn Dapper
Creating a Data Access Layer using Microsofts ORM Entity Framework. Microsoft'S DAL Tutorial