@@ -33,11 +33,11 @@ EntityFrameworkExtras provides some useful additions to EntityFramework such as
3333
3434* Define a stored procedure class
3535
36- ~~~
36+ ~~~ csharp
3737[StoredProcedure (" storedproc_AddMemberWithAddresses" )]
3838public class AddMemberStoredWithAddressesProcedure
3939{
40- [StoredProcedureParameter(SqlDbType.NVarChar, ParameterName = "ForeName")]
40+ [StoredProcedureParameter (SqlDbType .NVarChar , ParameterName = " ForeName" )]
4141 public string FirstName { get ; set ; }
4242
4343 [StoredProcedureParameter (SqlDbType .NVarChar ,ParameterName = " SurName" )]
@@ -54,7 +54,7 @@ public class AddMemberStoredWithAddressesProcedure
5454
5555* A User Defined Table Type parameter is declared as a List<> (List<Address >). The UDT will also require some attributes:
5656
57- ~~~
57+ ~~~ csharp
5858[UserDefinedTableType (" udt_Address" )]
5959public class Address
6060{
@@ -71,7 +71,7 @@ public class Address
7171
7272* Execute the Stored Procedure with either a DbContext or an ObjectContext
7373
74- ~~~
74+ ~~~ csharp
7575DbContext context = new DbContext (" ConnectionString" );
7676
7777var proc = new AddMemberStoredWithAddressesProcedure ()
@@ -94,7 +94,7 @@ context.Database.ExecuteStoredProcedure(proc);
9494
9595* To add an Output parameter you just need to set the Direction parameter to ParameterDirection.Output.
9696
97- ~~~
97+ ~~~ csharp
9898[StoredProcedure (" storedProc_GetOldestAge" )]
9999public class GetOldestAgeStoredProcedure
100100{
@@ -105,7 +105,7 @@ public class GetOldestAgeStoredProcedure
105105
106106* Execute the Stored Procedure and the parameter will be set to the output parameter value
107107
108- ~~~
108+ ~~~ csharp
109109var proc = new GetOldestAgeStoredProcedure ();
110110
111111context .Database .ExecuteStoredProcedure (proc );
0 commit comments