Code Monkey home page Code Monkey logo

lazorm's Introduction

lazorm

LAZy people's OR Mapper

What is lazorm?

Lazorm is a super simple OR mapper library for .Net Core.

one minute demo(youtube link)

Watch the video

Overview

Lazorm has a two sides, one is a code generator, ahother is a runtime to let generated codes work.

Key functions

  1. Entity Class generator from database

lazorm provides a command line tool which create class files
with full of table columns as properties.

Available database products are following:

  • SQL Server
  • Oracle
  • MySQL
  • SQLite

The generated code holds your connectionstring in appsettings.json. So you feel easy to run entity codes.

  1. Rich functions on coding

They also have full of crud functions as default. So all you have to do is call Get method and you will have your data brought. You can also specify your sql to get/modify your data.

  1. Source code provision

You can get all crud functions as source code generated into parcial class. So if you think it's not your cup of tea, you can write your own methods into another half of parcial class.

Isn't it a zero-risk approach to give a try?

Installation

** Important **

lazorm has two part of library:

  1. code generator (as a .Net Core tool - also a.k.a. tool-path tool)
  2. library (as a nuget package)

1. Installing code generator

Global install tool by typing(RECOMMENDED):

dotnet tool install -g lazorm

Or local install tool on your project if you like:

dotnet new tool-manifest
dotnet tool install lazorm

Then you go 2 things respectively on your project:

2. Generating OR Mapper code

echo "creating entity files into Entities/AutoGenerated dir"
dotnet lazorm -k mssql -c "your connectionstring here" -m

3. Installing runtime into your project(then it runs properly)

echo "installing library that entities depends"
dotnet add package lazorm

Tutorial

You make a project by typing

dotnet new console -n LazormTest
cd LazormTest

Then create entity from database

echo "creating entity files into Entities/AutoGenerated dir"
dotnet lazorm -k mssql -c "your connectionstring here"

echo "installing library that entities depends"
dotnet add package lazorm

That's it! You will see entity files in Entities directory.

Don't forget to install package lazormlib. Because entity files do need it to work with.

In your program.cs file, you modify Main method

// entitiy class name is for example.
var countries = Lazorm.Country.Get(ID: 1);
foreach(var country in countries)
{
    Console.WriteLine("Name: {0}", country.Name);
}

You run project with F5, That's it! You will see the name of countries there.

Object.Get and Object.SaveChanges are essentials of this framework. NO MANAGERS! Because our entities can do everything by their own.

"Mom, don't change my clothes! I can do it with my own!"

Database first oriented

We know code first is a good approach but this product is oriented database first.

Reason: It gets simpler with DB first approach - because no migration table polution nore annoying migration failure.

lazorm's People

Contributors

satrex avatar

Stargazers

 avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.