EntityFramework support vs direct SQL #1740
-
reviewing the oqtane framework and it looks very promising and interesting. Any idea if there would ever be interest in supporting entityFramework based Repository model? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Oqtane is already using repository pattern, have a look to https://github.com/oqtane/oqtane.framework/tree/dev/Oqtane.Server/Repository |
Beta Was this translation helpful? Give feedback.
-
@RussKahler1970 as @hishamco mentioned, Oqtane already uses an EF Core Repository model and does NOT rely on direct SQL. If you look in the Oqtane.Server\Repository folder you will see the repository classes for all of the entities which the framework currently supports. If you review the code more closely you will notice that the SQLRepository you identified is not a generic repository... it is only used in one very specific scenario - to allow a host user to navigate to a SQL Manager module in the UI and enter raw SQL statements that are executed against a specific database for development/debugging purposes. All other scenarios have dedicated repositories implemented using standard EF Core. A decision was made a few years ago to NOT use a generic repository pattern as in practice there are many repositories which require custom methods that do not conform to a generic set of repository methods - and in essence EF Core itself is a generic repository so it does not offer much benefit to add another unnecessary layer of abstraction ). The current repository has been optimized to support multiple types of databases as well as multi-tenancy requirements, so I would be very hesitant to refactor it unless there is a very clear and obvious benefit. |
Beta Was this translation helpful? Give feedback.
@RussKahler1970 as @hishamco mentioned, Oqtane already uses an EF Core Repository model and does NOT rely on direct SQL.
If you look in the Oqtane.Server\Repository folder you will see the repository classes for all of the entities which the framework currently supports. If you review the code more closely you will notice that the SQLRepository you identified is not a generic repository... it is only used in one very specific scenario - to allow a host user to navigate to a SQL Manager module in the UI and enter raw SQL statements that are executed against a specific database for development/debugging purposes. All other scenarios have dedicated repositories implemented using standard EF …