[Questions] Getting started with C# database application development – Code First, Database First, Entity Framework and other options…


I'm getting started with C# and I wanted to get people's opinions on database options.

I was reading a post either here or on /r/learnprogramming and there was a very interesting discussion within it about the benefits and drawbacks of the different ORMs and approaches people take when developing in C#. I thought I had saved the particular thread and a very detailed comment in it but I had not and I could not find the thread again.

So, I am very familiar with SQL and I feel like a database first approach would suit me the majority of the time. I have already used the Entity ADO Model to connect to an existing SQL Server database and while that all works fine, there seems to be a lot going on that is a little beyond me at the moment.

I think I would like to start off small reading or writing to an existing database using raw SQL to begin with and then maybe move on to creating a model based on my existing tables and go from there rather than having all of the scaffolding done for me. What is a good way to go with this for a beginner? Console applications and basic MVC applications are what I have been messing with so far and I really get the MVC pattern, aside from database contexts, interfaces and such – Models, Views and Controllers make sense as I have created all of these by hand at some stage but I have not done the same for the database connections et al.

The majority of material I seem to find depend on this GUI scaffolded approach which I find doesn't help me learn very well, and bogs me down once I want to try something a little different. I have toyed with Python/Flask/SQlAlchemy to some degree and this makes the database integration so smooth and transparent – is there anything like this that could start me from the ground up in C#? I really need to walk here before I can run and with the VS generated code, I feel like I am being thrown in at the deep end.

So, where to start and find resources such as these? Is there anything as simple as transparent as, say SqlAlchemy to cut my teeth on? Using that I could create a connection to an existing database and then simply map a model to an existing table. For other apps, of course I would like to use migrations but again, I see this as a progression rather than one of the first steps.

Any really useful guides out there that don't rely on Entity and code generated in the IDE?

Thanks in advance for any help or advice.

Please be gentle 🙂

by zombie_soul_crusher via /r/csharp

Leave a Reply