Click here to Skip to main content
14,333,836 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
 
GeneralRe: MS Forum People are Pretentious Jerks Pin
raddevus12-May-19 11:16
mvaraddevus12-May-19 11:16 
GeneralRe: MS Forum People are Pretentious Jerks Pin
Sander Rossel12-May-19 20:26
professionalSander Rossel12-May-19 20:26 
GeneralRe: MS Forum People are Pretentious Jerks Pin
#realJSOP12-May-19 11:52
mve#realJSOP12-May-19 11:52 
GeneralRe: MS Forum People are Pretentious Jerks Pin
Sander Rossel12-May-19 20:28
professionalSander Rossel12-May-19 20:28 
GeneralRe: MS Forum People are Pretentious Jerks Pin
Super Lloyd12-May-19 15:11
memberSuper Lloyd12-May-19 15:11 
GeneralRe: MS Forum People are Pretentious Jerks Pin
Sander Rossel12-May-19 20:32
professionalSander Rossel12-May-19 20:32 
GeneralRe: MS Forum People are Pretentious Jerks Pin
Gerry Schmitz12-May-19 11:09
mveGerry Schmitz12-May-19 11:09 
GeneralRe: MS Forum People are Pretentious Jerks Pin
#realJSOP12-May-19 11:42
mve#realJSOP12-May-19 11:42 
Yeah, I have a DAL that is inherited by a database-specific BLL that is called from various locations in the app.

The DAL exposes four public methods that use generics and reflect to populate the specified object

public List<T> ExecuteStoredProc<T>(string storedProc, params SqlParameter[] parameters)
public int ExecuteStoredProc(string storedProc, params SqlParameter[] parameters)

// I only included these because someone somewhere may want to use a query instead of a stored 
// proc, but in our case, we only use stored procs.
public List<T> ExecuteQuery<T>(string query, params SqlParameter[] parameters)
public int ExecuteQuery(string query, params SqlParameter[] parameters)


There's a BLL for each database that contains (or will contain) a method for each stored proc for that database. Usage goes like this:

DBObjectDBName dbo = new DBObjectDBName(Globals.ConnectionStrings.GetConnectionSTring("DBName");
List<MyDataModel> model = dbo.ExecuteStoredProc<MyDataModel>("dbo.StoredProcName", parameters (if any)); 


I have a base Controller class where I can create a property to create the DBObject instance, thus reducing the usage block to a single line in the outward facing code. One of these days, I'm going to write an article about it.

I don't need EF watching over me. I know how to write code. Smile | :)
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

GeneralRe: MS Forum People are Pretentious Jerks Pin
Gerry Schmitz12-May-19 13:36
mveGerry Schmitz12-May-19 13:36 
GeneralRe: MS Forum People are Pretentious Jerks Pin
Mycroft Holmes12-May-19 13:47
memberMycroft Holmes12-May-19 13:47 
GeneralRe: MS Forum People are Pretentious Jerks Pin
#realJSOP12-May-19 14:36
mve#realJSOP12-May-19 14:36 
GeneralRe: MS Forum People are Pretentious Jerks Pin
Mycroft Holmes12-May-19 18:14
memberMycroft Holmes12-May-19 18:14 
GeneralRe: MS Forum People are Pretentious Jerks Pin
#realJSOP12-May-19 22:23
mve#realJSOP12-May-19 22:23 
GeneralRe: MS Forum People are Pretentious Jerks Pin
GuyThiebaut12-May-19 22:26
professionalGuyThiebaut12-May-19 22:26 
GeneralRe: MS Forum People are Pretentious Jerks Pin
CPallini12-May-19 21:43
mveCPallini12-May-19 21:43 
GeneralPeople are Pretentious Jerks Pin
den2k8813-May-19 0:16
professionalden2k8813-May-19 0:16 
JokeTurning vegan... Pin
Mike Hankey12-May-19 1:55
professionalMike Hankey12-May-19 1:55 
GeneralRe: Turning vegan... Pin
OriginalGriff12-May-19 2:19
protectorOriginalGriff12-May-19 2:19 
GeneralRe: Turning vegan... Pin
Nelek12-May-19 2:23
protectorNelek12-May-19 2:23 
GeneralRe: Turning vegan... Pin
OriginalGriff12-May-19 2:43
protectorOriginalGriff12-May-19 2:43 
GeneralRe: Turning vegan... Pin
Nelek12-May-19 3:08
protectorNelek12-May-19 3:08 
GeneralRe: Turning vegan... Pin
theoldfool12-May-19 4:35
professionaltheoldfool12-May-19 4:35 
GeneralRe: Turning vegan... Pin
0x01AA12-May-19 5:39
professional0x01AA12-May-19 5:39 
GeneralRe: Turning vegan... Pin
Sander Rossel12-May-19 8:23
professionalSander Rossel12-May-19 8:23 
GeneralRe: Turning vegan... Pin
RickZeeland12-May-19 7:42
mveRickZeeland12-May-19 7:42 

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.