I'm new to EF but have some experience with ado.net but more with DAO and ADO (yes I'm old school).
I'm in a position where I have some time to deliver a new solution so I'm going to take the opportunity to learn EF.
It's basically going to be a custom error logging system for one of our core systems.
In simple terms it is going to be a SQL back end with a WPF front end (yes I'm learning that too)
My general design style is to retrieve required data at load time and hold this in various classes in the app. So for instance if I need to retrieve data based on a user ID from a table I would use a datareader (or connectionstring) and either add the results to a datatable or array and then populate the class from the datatable or array.
I don't really understand where EF would store the data say when you run the following:
Using userContext As New userEntities
Dim qry = From s In userContext.tUsers _
Where (s.windowsID = LCase(Environment.UserName))
End Using
qry will be destroyed when the block ends so do I have to add the results to a class or are the results actually already held in userEntities.tUser, if so I want to retrieve them, say by doing something like:
Dim username as string = tUser.UserName is that in essence calling a db query or is it fact referring to a derived class?
As you can see I'm confused, things used to be so much easier to conceptualize than they are now.
I'm in a position where I have some time to deliver a new solution so I'm going to take the opportunity to learn EF.
It's basically going to be a custom error logging system for one of our core systems.
In simple terms it is going to be a SQL back end with a WPF front end (yes I'm learning that too)
My general design style is to retrieve required data at load time and hold this in various classes in the app. So for instance if I need to retrieve data based on a user ID from a table I would use a datareader (or connectionstring) and either add the results to a datatable or array and then populate the class from the datatable or array.
I don't really understand where EF would store the data say when you run the following:
Using userContext As New userEntities
Dim qry = From s In userContext.tUsers _
Where (s.windowsID = LCase(Environment.UserName))
End Using
qry will be destroyed when the block ends so do I have to add the results to a class or are the results actually already held in userEntities.tUser, if so I want to retrieve them, say by doing something like:
Dim username as string = tUser.UserName is that in essence calling a db query or is it fact referring to a derived class?
As you can see I'm confused, things used to be so much easier to conceptualize than they are now.
Last edited: