This project has moved. For the latest updates, please go here.

INTRODUCTION

LUNA ORM creates all code you need to use a database without write any method to access data. All code is optimized for performance and flexibility and usable in Desktop, Web or any other .Net project.

At this moment LUNA ORM generate only Vb.net code but you can use them easily with C# Project (i write about them in the sdk Section)

LOADING A DATASOURCE

So... we come to the practical aspect. For simplicity in our example and code snippets we use a simple MS Access Database (see above), but Luna ORM support MS Access (mdb or accdb) , Sql Server (standard, express, ecc ecc), MySQL/MariaDB and any other OleDb (using Access Source to create an input structure).

So we start from a simple test database containing the tables Customers, Groups and Phones

We start Luna and, after selecting type of database Access and selecting the file, click on the button "Load DB"

qWFuJnOl



* Source type - Luna ORM now support MS Access Database (*.mdb and *.accdb), SQL Server and Luna Project File (*.lds). (Luna ORM can support teorically any type of Database that can used by OleDB)

OPTION
The option "Load View" load any view as a table and generate code for that. Note that this function create method for insert, delete and update. This is wrong and in future release i resolve the problem.

NOTE
In another article in this SDK Section in future i explain integration with MS Visual Studio and TFS. For now you have to know that after any generation Luna ORM create (in the root folder of generated files) a Luna Project File (*.lds). Opening this file as source from Luna ORM you can work/modify/regenerate all classes manteining the Name of Class that you previously insert.

BEST PRATICES
Use as Datasource the Development Database; Luna ORM save in each Luna Project File (*.lds) a reference to original datasource. Next Luna can work disconnected from Original DataSource but the best result is to reopen any time you need the some Project file, because when you REOPEN a Luna Project File, Luna automatically check for change in the original database and show you an updated structure to change or regenerate.

So you can change your database, regenerate DataLayer with two click and replace DataLayer File without lost any custom method or property you have created (but we see them in another article).

Last edited Feb 5, 2015 at 11:52 AM by Lunadix, version 2