0

I have a database for which I want to generate the repository and entity/model classes with all CRUD operations. To achieve this I found a tool, named Entity Developer (https://www.devart.com/entitydeveloper/download.html), which is generating all the stuff, but without CRUD operation for each entity as tools is generating just an empty class named ABCRepository, so again I have to write the code for each repository class. Though same task can be achieved from Entity framework, except than the repository classes( which does not contain any CRUD operations).

Can any one help me to get the solution?

Update: I have followed this tutorial (https://dzone.com/articles/implementing-the-repository-pattern-using-c-and-en), according to this, Entity Developer should generate the "Repository per entity type" with operations, but while following and creating the Data Model, I get only empty ABCRespository and IABCRepository classes. I tried multiple ways to create the Data Model, yet not successful.

Das Khatri
  • 93
  • 6
  • Entity requires c# classes to mock the database and a EDMX mapping file to cross reference the database to the classes. Using VS menu Add DataSource will automatically create the classes and EDMX which only need to performed once. – jdweng Dec 28 '20 at 13:35

1 Answers1

1

To achieve this I found a tool, named Entity Developer (https://www.devart.com/entitydeveloper/download.html), which is generating all the stuff, but without CRUD operation for each entity as tools is generating just an empty class named ABCRepository

Please check the Generate Partial property of your Repository And Unit of Work template. If it is set to True (by default), the code is generated in ABCRepository.Generated.cs. The code file ABCRepository.cs is created for user code that will not be overwritten by the designer.

Devart
  • 119,203
  • 23
  • 166
  • 186
  • Fortunately I had this option earlier. Thanks a lot for your input, it is correct answer and will be helpful for others too. – Das Khatri Jan 07 '21 at 13:47