Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7180365
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T17:19:54+00:00 2026-05-28T17:19:54+00:00

Consider I have built DAL.dll which is a class library containing an Entity Framework

  • 0

Consider I have built DAL.dll which is a class library containing an Entity Framework edmx. In the Designer.cs, the following imported stored procedure is defined:

    <Function Name="Login_User" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo">
      <Parameter Name="Login_Name" Type="nvarchar" Mode="In" />
      <Parameter Name="Password" Type="nvarchar" Mode="In" />
      <Parameter Name="SP_Return_Code" Type="int" Mode="InOut" />
    </Function>

Below I have used Reflection to find type1 as an ObjectContext type. How do I discover the Login_User stored procedure by reflecting type1?

    private static void ReflectionTest()
    {
        var asm = Assembly.LoadFrom(@"C:\DAL.dll");

        // list stored procedure calls
        foreach (var type in asm.GetTypes())
        {
            if (type.BaseType == typeof(ObjectContext))
            {
                foreach (var type1 in type.GetMethods())
                {
                    // how do I reflect against type1 for its stored procedure names?
                }
            }
        }
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T17:19:54+00:00Added an answer on May 28, 2026 at 5:19 pm
    1. First you will need to import your stored procedures as Function in your Entity model. Refer to this link for HowTo: http://ashishrocks.wordpress.com/2010/09/05/entity-framework-using-select-stored-procedures-for-entities-having-same-column-names/

    2. At the time you are doing this, make sure you use some kind of naming convention for your Function Import Name. For example, prefix SP_ to all your stored procedure function imports.

    3. Once you add your SPs as functions in your Entity Model, you should be able to see them in your Model.Designer.cs. Compile updated DAL.

    Now you can get your stored procedures like this:

    Assembly assembly = Assembly.LoadFrom(@"C:\DAL.dll");
    
    foreach (MethodInfo methodInfo in from type in assembly.GetTypes()
                                      where type.BaseType == typeof (ObjectContext)
                                      from methodInfo in type.GetMethods()
                                      where methodInfo.Name.StartsWith("SP_")
                                      select methodInfo)
    {
        Console.WriteLine(methodInfo.Name);
    }
    
    Console.ReadLine();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider I have an anchor which looks like this <div class=res> <a href=~/Resumes/Resumes1271354404687.docx> ~/Resumes/Resumes1271354404687.docx
Consider I have the following text in a UILabel (a long line of dynamic
Consider I have the following interface: public interface A { public void b(); }
Consider I have an array of elements out of which I want to create
Consider I have a table with notes which could be associated with zero or
Now I have my website built on PHP & Mysql. Consider this like a
Consider the following scenario which I'm due to find myself in shortly: You're to
Let's assume that we have web site which runs on IIS 7.5 and built
I have a model which has 2 fields, a and b like this: class
Consider I have the following graph: A -> B B -> C C ->

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.