Posts

Showing posts with the label RepoDB ORM

Donate

Create An ASP.NET Core MVC CRUD Website Using RepoDB ORM And SQL Server

Image
Hello All! This blog post illustrates on how to create an ASP.NET Core 5.0 MVC CRUD Web Application using RepoDB ORM and SQL Server. RepoDB is a hybrid-ORM library for .NET which is an alternative ORM to both Dapper and EntityFramework. This framework was created by Michael Camara Pendon. This project also integrates Bootstrap 4 for styling and Unit Of Work with Repository Design Pattern as the data mechanism. I also installed the Font Awesome 5 via Libman for showing icons to the button controls. So to get started, perform the following steps below. I. Project Setup 1. Create an Athletes table in your database using the script provided. This table will serve as the dataset for this project. USE [your_database] GO /****** Object: Table [dbo].[Athletes] Script Date: 5/5/2021 4:13:47 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[Athletes]( [ID] [int] IDENTITY (1,1) NOT NULL , [Name] [varchar](100) NULL , [Age] [int] NULL , [Co

RepoDB Error - There is no database setting mapping found for 'System.Data.SqlClient.SqlConnection'

Good day! When I was working with RepoDB ORM I encountered this error {"There is no database setting mapping found for 'System.Data.SqlClient.SqlConnection'. Make sure to install the correct extension library and call the bootstrapper method. You can also visit the library's installation page (http://repodb.net/tutorials/installation)."}. I may have skipped a step in the docs or basically used the wrong RepoDB package for my app. So to fix the issue I made sure that the package I installed was the RepoDB.SQLServer Nuget package and call the SqlServerBootstrap.Initialize() method in my application. In ASP.NET MVC, I added this code in Global.asax.cs Application_Start() method. protected void Application_Start() { AreaRegistration.RegisterAllAreas(); RouteConfig.RegisterRoutes(RouteTable.Routes); RepoDb.SqlServerBootstrap.Initialize(); } In WPF, I added the one liner code in the MainWindow's constructor method. public MainWindow() { InitializeCompo

WPF CRUD With DataGrid, RepoDB ORM And C#.NET

Image
Good day Gents, Here's a basic tutorial on how to integrate the RepoDB ORM into your WPF desktop application. I already have written an article in ASP.NET MVC web application here using the said ORM and I realized that I have to create an example for the desktop as well. To proceed working with the code, you need to run the create table script from this post WPF CRUD With DataGrid, Entity Framework And C#.NET . Next is to add a model class that maps the information from the database table to an object or list of objects. public class Students { public int ID { get ; set ; } public string Name { get ; set ; } public int Age { get ; set ; } public string Address { get ; set ; } public string Contact { get ; set ; } public Students() { ID = 0; Name = string .Empty; Age = 0; Address = string .Empty; Contact = string .Empty; } } Add an interface to the project that has the method signatures used in the actual repository class. The interface meth

ASP.NET MVC Web Application CRUD Using RepoDB ORM

Image
Happy Sunday Awesome Programmers! See the ASP.NET Core MVC version of this tutorial here Create An ASP.NET Core MVC CRUD Website Using RepoDB ORM And SQL Server A week ago, I received a newsletter regarding a promising ORM called RepoDB. This ORM library is created by Michael Pendon who is an application architect in Europe. According to him, RepoDB is an open-source . NET ORM library that bridges the gaps of micro-ORMs and full-ORMs. It helps you simplify the switch-over of when to use the BASIC and ADVANCE operations during the development. It is your best alternative ORM to both Dapper and EntityFramework . It also provides query support to several databases such as MySQL, SQL Server, PostGreSQL and there's a survey that this ORM's performance is faster than Dapper. I've used Dapper before and Entity framework in my ASP.NET MVC applications so, it's time to try using this tool by creating a simple ASP.NET MVC CRUD Application(Create, Read, Update, Delete) Applic

Donate