RapidORM.dll 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package RapidORM.dll --version 1.0.0                
NuGet\Install-Package RapidORM.dll -Version 1.0.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="RapidORM.dll" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add RapidORM.dll --version 1.0.0                
#r "nuget: RapidORM.dll, 1.0.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.
// Install RapidORM.dll as a Cake Addin
#addin nuget:?package=RapidORM.dll&version=1.0.0

// Install RapidORM.dll as a Cake Tool
#tool nuget:?package=RapidORM.dll&version=1.0.0                

Expressive, dynamic and functional Object Relational Mapping technology that allows you to easily perform CRUD operations. RapidORM lets you focus more on the behavior of the app instead of spending more time with the DB communication.

More so, RapidORM supports multiple databases in the industry(and growing). <br/> Depending on your preference, RapidORM also allows you to execute good ol' SQL queries via the QueryBuilder.

Supported Database

SQL Server, MYSQL

Getting Started

  • Create a database wrapper class inside your project. Create a static method. The content shoud be the instantiation of the DBConnection class. Reference RapidORM.Data. Like so,
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using RapidORM.Data;

namespace RapidORM.Tests.Core
{
    public class Database
    {
        public static void UseSqlDb()
        {
            DBContext.ConnectionString = new DBConnection()
            {
                Server = "",
                Database = "",
                Username = "",
                Password = ""
            };
        }
    }
}
  • Now, create your model. Your model should be the counterpart of your DB table. Hence, if I have a "department" table, you could have a "Department" class as well. Please also note that you can interactively create your model using the RapiORM Entity Creator.

  • Reference the basic libraries → RapidORM.Data, RapidORM.Helpers, RapidORM.Interfaces. You can choose what library to remove and/or add depending on your requirements.

  • Map your properties

[IsPrimaryKey(true)]
[ColumnName("ID")]
public int Id { get; set; }

[ColumnName("Column1")]
public string Column1 { get; set; }
  • Declare the DB Entity
private SqlEntity<MyClass> dbEntity = null;
  • Instantiate user entity on default constructor
public MyClass()
{
    dbEntity = new SqlEntity<MyClass>();
}
  • Create constructor required for data retrieval
public MyClass(Dictionary<string, object> args)
{
    Id = Convert.ToInt32(args["ID"].ToString());
    Column1 = args["Column1"].ToString();         
}
  • Here's the sample model.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using RapidORM.Data;
using RapidORM.Helpers;
using RapidORM.Attributes;
using RapidORM.Interfaces;
using RapidORM.Client.MySQL;
using RapidORM.Common;

namespace MyNamespace
{
    [TableName("DB Table Name")]
    public class MyClass
    {
        [IsPrimaryKey(true)]
        [ColumnName("ID")]
        public int Id { get; set; }

        [ColumnName("Column1")]
        public string Column1 { get; set; }

        private SqlEntity<MyClass> dbEntity = null;

        public MyClass()
        {
            dbEntity = new SqlEntity<MyClass>();
        }

        //Required for Data Retrieval
        public MyClass(Dictionary<string, object> args)
        {
            Id = Convert.ToInt32(args["ID"].ToString());
            Column1 = args["Column1"].ToString();         
        }

        public void GetAllUserProfiles()
        {
            var myList = dbEntity.GetAllObjects();
            foreach (var item in myList)
            {
                Console.WriteLine(item.Column1);
            }
        }

        //Your other methods here(Please see the test project for reference)
    }
}
  • That should be it.
Product Compatible and additional computed target framework versions.
.NET Framework net is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

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.10 1,129 11/29/2017
1.0.0 1,086 11/20/2017

This will be the initial product version. More info and usage are shown on the documentation