Example #1
0
        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);
            }
        }