I have nothing against using a repo per table, sometimes I do it. Sometimes, a repo will be for a task or some kind of logical grouping. 90% of dapper is just mapping from a table to a class, hardly any code involved. Even to generate a class to represent a table is trivial. The advantage for me and working with different levels of developers is that its simple to understand, simple to find the correct repo and method. EF may be different now but for most things I don't need a full ORM and EF was a pain. I'm also perfectly happy writing my own SQL and if I need I can just add it to the repo. I don't see this as over engineering, it's pretty simple. I used to be into EF but I found it harder and harder to justify it over a micro-orm. It may be different now and easy to setup, configure and use but still it's a layer I don't need. I also have nothing against lots of controllers but I can't understand it being per table in your example, usually its for the UI and specific task. I've always found it interesting why people use EF, personally I stopped using it when I couldn't justify to a client why I wanted to use it over PetaPocco (wow not thought of that for a while).
Ste S
Posts
-
This is what you get when you have junior programmers write an application in .NET Core -
Workflows and batch filesI've used Hangfire in the past for scheduled database jobs, though I've not used any of the fancy workflow options available with it. Hangfire Pro[^]
-
ORM Quick Survey+1 for Dapper along with Dapper.Contrib. I actively avoid contracts that state EF as a requirement. I understand for some people it's the dog danglies but I can't see a compelling case to use EF. I know that's just my mileage but I genuinely would like to know why people use EF as opposed to a micro-orm like Dapper or PetaPoco.
-
I want to build a websiteI think you friend at the pub is talking about WebAssembly, Don't think it's ready for the big league yet - bit of background from Hanselman... Net and WebAssembly MVC is not dead by any means, still going strong. In the past for small projects I've purchased Bootstrap templates and customised to meet my needs, loads of sites out there, I've used these guys (see link below). Advantage of using bootstrap is if you follow the grid system you can get something that looks good and works well on a desktop browser and a mobile device. WrapBootstrap For logos etc I've used designer friends or online bidding sites for example... 99 Designs If you are using it as a learning exercise then you could go down the route of using Asp.Net core, again you can use MVC etc. Learning ASP.NET Core There are a few frameworks out there for single page apps and seem popular in the freelance world. It's up to you if you want to learn them. Angular React Vue Alternatively, if you don't want to tinker just download a wordpress theme.
-
DapperI've used Dapper a few times. I really like it and as others have said it generally gets out of the way and works well at mapping your sql to an object or collection of objects. I use it with Dapper extensions which makes simple selecting/updating etc pretty simple. I invested a lot of time in learning EF and it was hard to make the move but honestly I've never found a need to go back to using EF. EF seems overly complex, at least for my needs and I fail to see a good reason for using EF over a micro orm like Dapper or PetaPoco (which i also like).