Changelog 1.4.4 (Jan 19, 2016) - Fixed bug on OrderBy clause - Fixed bug where finding Web.Config file - Updated UI - Minor optimizations 1.4.3 (Jan 8, 2016) - Fixed important bug on Connection Strings - Renamed method names of IViewModel - Other bugs fixed 1.4.2 (Jan 7, 2016) - NEW FEATURE: Automatic project creation - NEW FEATURE: Linked default ADO .NET Entity Models with the extension - UI Improvements - Some bugs fixed 1.4.1 (Jan 6, 2016) - Added Count method to IRepository - Added aditional process validators - Optimized error control - Minor bugs fixed 1.4.0 (Jan 4, 2016) - Added pagination and orderBy - Optimized performance - Increased width of log box - Minor bugs fixed
Getting started The tool button is located on Project>Generate repository pattern.
This is the main window, you have the option to create completelynew repository project and add an EDMX model from EF6 on it. But, if you already have a project, you have the option to add the repository code to it. In any case, always the EDMX must be in the same project as the repository.
In the settings panel you can set the name of the EDMX models folder. (New options will be added soon)
Create new repository project 1. Once you loaded a solution, click on Create new repository project on the main window.
2. Enter a valid project and .EDMX file name and click generate and wait a couple of seconds.
3. A window like that appears on the screen, selectEF Designer from Database and click Next.
4. If you don't have any connection, click on New Connection. If you have already one, click on Next. 5. Select Microsoft SQL Server and click Continue.
6. Enter the required credentials and select the correct database name.
7. Select Yes on radio button, and clickNext.
8. Select the desired tables to import and clickFinish, your model will be created.
When RPG process starts, you can see the status and history of all the actions done.
That's the final result of all the process, it just works ;)
Usage DbContext andEntityRepository should be injected by an IoC, like Unity. In case you have divided repository project and WebAPI or MVC project, you have to import the connectionStrings of the repository on the other project.
A basic usage that can be done from an API Controller, for example.
Pagination, OrderBy andCount queries
This extension is in constant progress and will be upgraded with new features. Available for Visual Studio 2015 Community/Pro/Enterprise (Not tested in other versions). Please, send me a feedback about feature requests or bugs. Thanks!
API Controller Generator,soon. |