Model.Context.cs:
public virtual int DbStoreProcedureName(ObjectParameter output_string, Nullable<int> inputId)
{
var inputIdParameter = inputId.HasValue ?
new ObjectParameter("inputParam1", inputId) :
new ObjectParameter("inputParam1", typeof(int));
return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("DbStoreProcedureName", output_string, inputIdParameter);
}
Usage:
var inputValue = 5;
var outputParam = new ObjectParameter("output_string", typeof(string));
Context.DbStoreProcedureName(outputString, intputValue);
var outputString = outputParam.Value.ToString();
No comments:
Post a Comment