private static void CallStoredProc() { using (AutoLotEntities context = new AutoLotEntities()) { ObjectParameter outParam = new ObjectParameter("petName", typeof(string)); context.GetPetName(83, outParam); Console.WriteLine(outParam.Value); } }
private static void CallStoredProc() { using (AutoLotEntities context = new AutoLotEntities()) { ObjectParameter input = new ObjectParameter("carID", 83); ObjectParameter output = new ObjectParameter("petName", typeof(string)); // Call ExecuteFunction off the context.... context.ExecuteFunction("GetPetName", input, output); // ....or use the strongly typed method on the context. context.GetPetName(83, output); Console.WriteLine("Car #83 is named {0}", output.Value); } }