Code Generation Using Repository Factory!!

From the time, I've become familiar with Repository Factory, I've been continuously using it to generate my data access layer code. It has some few steps that i normally follow to successfully generate my data layer which contains business entities, stored procedures and repository classes. For this, i have installed DataAccessGuidancePackage.msi.

After installing guidance package, i create a class library project from my solution explorer. And then I choose Guidance Package Manager submenu from Tools mainmenu.

 

Then, I enable the guidance package manager and I select the Repository Factory CheckBox.

Now, I'm ready for generating code.Then, I right click the project and specify its reposibilities to be by checking all options as shown below.

After that, I add the database connection and it will generate app.config file for me.

Then, I select "Create business entities from database" option as shown above and select the tables for which i need to generate entities as below. It will generate properties for each field and class for each table.

 

Likewise, following the same process as above, I select the tables this time, for which I have to generate CRUD methods and, it'll generate SQL scripts for me which i run in MSSQL database.

 

Finally, most important is that, I select option to create repostiory classes. It will generate a whole bunch of classes within a minute. If I've to write those code, it would take weeks for me, though my typing speed is not so poor.

 It has helped me very much. Now, I can use this repository classes to directly bind data with data controls in presentation layer or just use in business object layer. Why not try yourself ..?

 

 

 

 

Published 10-17-2008 2:25 AM by Padam Raj Gurung
Filed under:

Comments

# re: Code Generation Using Repository Factory!!

Friday, October 17, 2008 6:59 AM by Risman Adnan

Good posting!

Have you try ADO.NET Entity Framwork / LINQ to SQL? Cool feature inside VS 2008 SP1.

# re: Code Generation Using Repository Factory!!

Saturday, October 18, 2008 12:30 AM by Padam Raj Gurung

No, I haven't. Now, I'll try. Thanks.