I come from an Objective-C programming background and as such, am used to using Core Data for storing my data. Core data allows you to define fields (attributes) which you can then refer to as if they were objects in code, for each item in the database.
I wondered if there is a similar way of doing things for C#.
A bit more background
I have a treeview on my winform. The treeview allows people to add and remove new nodes. I’ve created a subclass of TreeNode so I can store a little more information against each node but I’d like to have all of the database transactions for adding / deleting done as part of this subclass. For instance, when I delete a node from the tree that has subnodes, I can easily remove this from the tree by calling Remove (knowing it will remove all subnodes too), but I also need the database to keep those changes too.
So, as above – is there a way to treat DB records as objects?
Hope that’s clear enough!
Entity Framework, LLBLGEN, NHibernate to name a few ORMs
I would suggest looking at Beginner’s Guide to ADO.NET Entity Framework
EntityFramework (Nuget Package) (Nuget is the preferred way to install packages such as EF)
Also, take a look at Sam Saffron’s How I learned to stop worrying and write my own ORM and Small is Beautiful – .NET Micro ORMs