Click here to Skip to main content
15,887,485 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionRe: rename image upload Pin
ZurdoDev16-May-16 3:07
professionalZurdoDev16-May-16 3:07 
QuestionApplication design for multiple databases Pin
Stephen Holdorf13-May-16 2:24
Stephen Holdorf13-May-16 2:24 
AnswerRe: Application design for multiple databases Pin
Gerry Schmitz13-May-16 4:16
mveGerry Schmitz13-May-16 4:16 
AnswerRe: Application design for multiple databases Pin
Stephen Holdorf13-May-16 9:24
Stephen Holdorf13-May-16 9:24 
GeneralRe: Application design for multiple databases Pin
Stephen Holdorf14-May-16 10:26
Stephen Holdorf14-May-16 10:26 
GeneralRe: Application design for multiple databases Pin
Nathan Minier15-May-16 3:13
professionalNathan Minier15-May-16 3:13 
GeneralRe: Application design for multiple databases Pin
Stephen Holdorf15-May-16 9:53
Stephen Holdorf15-May-16 9:53 
GeneralRe: Application design for multiple databases Pin
Nathan Minier16-May-16 1:28
professionalNathan Minier16-May-16 1:28 
You're looking at it incorrectly.

When you handle objects in Entity Framework, the underlying SQL is abstracted and, frankly, immaterial. You can treat a table, SP, or view in exactly the same manner, they're mapped out in the .edmx file. Since you're clearly using Database first, you'll want a look at Entity Framework Relationships - EF Designer[^]. In Entity Framework there aren't really "Joins" (since that's more of a database concept) there are "Associations" (as a more OOP concept) that are defined in your application, and parsed into joins by Entity Framework when querying the data source.

What this allows you to do is ignore the relational structure of the database and implement your own within the confines of your application. It doesn't change the database itself, just how your application looks at it. The best part is that it doesn't lean on the database to provide those details; ie the implementation of a store procedure has no impact on the functionality of Entity Framework.

For my money, it's generally best to use tables as a data source, but that's not always possible. In my mind it gives the purest look at the current state of the data and avoids some of the "gotchas" that can creep up when calling code (functions or SPs) rather than the data itself, or the holes that are often created by views. As a final caveat, tables are the only clean way to write transactions to the database. You can use Functions or Stored Procedures for that, but the implementation and business rules are dependent on the DBA, and I'm not a giant fan of handing off application critical items to a third party; at least in a data-driven, enterprise system. If those are your only options, though, you can work with them seamlessly.

Regardless of the underlying method used to derive the data, it is consumed in exactly the same way in an application context. You will have a collection of entities, defined as classes in your application, mapped to the database by your .edmx file, and instantiated as called by Entity Framework.

So the short answer (that I meandered greatly from) is that it doesn't matter what a Stored Procedures looks like or how it is invoked, as long as it exposes the data that you need in your application, to include the data that you need to form concrete Associations.
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli

GeneralRe: Application design for multiple databases Pin
Stephen Holdorf16-May-16 2:33
Stephen Holdorf16-May-16 2:33 
QuestionHow to use Datarelation to Create Menu in c# asp.net Pin
Ameer Dhotre12-May-16 21:02
Ameer Dhotre12-May-16 21:02 
QuestionRe: How to use Datarelation to Create Menu in c# asp.net Pin
ZurdoDev16-May-16 3:08
professionalZurdoDev16-May-16 3:08 
AnswerRe: How to use Datarelation to Create Menu in c# asp.net Pin
Ameer Dhotre23-May-16 1:41
Ameer Dhotre23-May-16 1:41 
GeneralRe: How to use Datarelation to Create Menu in c# asp.net Pin
ZurdoDev23-May-16 1:46
professionalZurdoDev23-May-16 1:46 
GeneralRe: How to use Datarelation to Create Menu in c# asp.net Pin
Ameer Dhotre26-May-16 0:48
Ameer Dhotre26-May-16 0:48 
QuestionQuery About getting difference between two dates in mvc4 Pin
Member 1251934112-May-16 2:52
Member 1251934112-May-16 2:52 
SuggestionRe: Query About getting difference between two dates in mvc4 Pin
Richard Deeming12-May-16 3:20
mveRichard Deeming12-May-16 3:20 
AnswerRe: Query About getting difference between two dates in mvc4 Pin
John C Rayan13-May-16 1:22
professionalJohn C Rayan13-May-16 1:22 
QuestionVisual Studio Community 2015 and Metro-UI-CSS Pin
xiecsuk10-May-16 3:26
xiecsuk10-May-16 3:26 
AnswerRe: Visual Studio Community 2015 and Metro-UI-CSS Pin
Richard Deeming10-May-16 6:34
mveRichard Deeming10-May-16 6:34 
GeneralRe: Visual Studio Community 2015 and Metro-UI-CSS Pin
xiecsuk10-May-16 6:46
xiecsuk10-May-16 6:46 
Questionhi experts..i'm using dropdownlist statically for gender field its not show me proper data when im update Pin
sunil39-May-16 19:25
sunil39-May-16 19:25 
AnswerRe: hi experts..i'm using dropdownlist statically for gender field its not show me proper data when im update Pin
ZurdoDev10-May-16 3:37
professionalZurdoDev10-May-16 3:37 
AnswerRe: hi experts..i'm using dropdownlist statically for gender field its not show me proper data when im update Pin
John C Rayan12-May-16 1:56
professionalJohn C Rayan12-May-16 1:56 
GeneralRe: hi experts..i'm using dropdownlist statically for gender field its not show me proper data when im update Pin
sunil317-May-16 20:19
sunil317-May-16 20:19 
GeneralRe: hi experts..i'm using dropdownlist statically for gender field its not show me proper data when im update Pin
John C Rayan18-May-16 1:12
professionalJohn C Rayan18-May-16 1:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.