DEV Community

Amina Elsheikh
Amina Elsheikh

Posted on

πŸ› οΈ How I Reduced My .NET Repository Development Time by more than 50% with RepoGen

As developers, we know the pain of writing repetitive code for repository classes β€” especially when working with stored procedures in .NET. Creating repositories manually can be time-consuming and error-prone, which leads to wasted development time and maintenance headaches.

That's when I found RepoGen. It’s a tool that automates the entire process of repository generation, and in this post, I’ll explain how I reduced my repository development time by 50% and kept my codebase clean and consistent.

🏁 The Problem: Repository Generation Without Automation

When starting a new .NET project, I often had to create repositories manually, mapping each stored procedure to a repository method. Every time the stored procedure changed, or new ones were added, I had to go back and update multiple repository classes. It felt like I was repeating the same process over and over again, which wasn’t productive.

The Challenges I Faced:

  • Repetitive Work: Writing similar methods for every stored procedure.
  • Error-Prone: Manually mapping SPs often led to missing or incorrect mappings.
  • Hard to Maintain: With multiple repositories, any changes in structure required refactoring multiple files.

⚑ The Solution: RepoGen

RepoGen is a NuGet CLI tool that automates repository and unit of work creation based on your stored procedures. Instead of writing the same code over and over again, RepoGen generates the repository classes for you. Here the key features:

  • βœ… Automatic Repository Generation – Generates repository classes mapped to SQL Server stored procedures.
  • βœ… Unit of Work Integration – Creates a UnitOfWork class to manage transactions across repositories.
  • βœ… Stored Procedure Mapping – Automates method creation inside repositories that correspond to stored procedures.
  • βœ… CRUD Generator – Generates full CRUD (Create, Read, Update, Delete) logic and models for SQL tables.
  • βœ… Clean Architecture Support – Supports multiple folder structures: Clean, Layered, Hexagonal, or Custom.
  • βœ… Batch Command Execution – Run multiple operations from a JSON batch script.
  • βœ… Dynamic DTO & Model Generation – Generates Data Transfer Objects and domain models from stored procedures or tables.
  • βœ… Endpoint Creation – Auto-generates RESTful controller endpoints (e.g., POST, GET, PUT, DELETE) alongside SP and CRUD mappings.
  • βœ… Offline & Secure – Operates fully offline with no external calls or telemetry.

πŸ“š Documentation

Full guides, step-by-step examples, and command references are available in the πŸ“˜ Wiki

πŸ“¦ Try It Yourself

RepoGen is available now as a NuGet package. If you're working on a .NET project and want to save time while keeping your code clean, give RepoGen a try!

You can find RepoGen on NuGet.

You can find RepoGen sample on GitHub.

πŸ“Ž Related Packages

πŸ“š More About RepoGen

πŸ™ Thank you for supporting the development of DEFC.Util.RepoGen. Let’s build clean, maintainable .NET applications together!

Top comments (0)