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

  • Home
  • SEARCH
  • 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 6611895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:01:49+00:00 2026-05-25T20:01:49+00:00

I have generated Entity CodeBlock for my database objects and choose some of my

  • 0

I have generated Entity CodeBlock for my database objects and choose some of my user defined scalar functions. But when i tried to double click on functions in Model.Store to import function i get this error.

Function imports cannot be created for composable functions.

How can i import my functions?

  • 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-25T20:01:50+00:00Added an answer on May 25, 2026 at 8:01 pm

    I don’t know what I was seeing with the ExecuteFunction, but it wasn’t working. I finally got an end-to-end solution together with help from this post and the article shown in the other responses.

    Step one is to get the function into your EDMX file:

        <Function Name="ProcessReplacements" ReturnType="nvarchar(max)" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="true" ParameterTypeSemantics="AllowImplicitConversion" Schema="Data">
          <Parameter Name="VersionId" Type="uniqueidentifier" Mode="In" />
          <Parameter Name="SurveyId" Type="uniqueidentifier" Mode="In" />
          <Parameter Name="Input" Type="nvarchar(max)" Mode="In" />
        </Function>
    

    Step two is to setup a class in the same namespace as the EDMX file (easily done by creating class in the same directory as the EDMX file:

    using System.Data.Objects.DataClasses;
    namespace Same.As.Edmx
    {
        public static class EdmFunctions
        {
            [EdmFunction("SurveyDesignerModel.Store", "ProcessReplacements")]
            public static string ProcessReplacements(Guid VersionId, Guid SurveyId, string Input)
            {
                throw new NotSupportedException("Direct calls are not supported.");
            }
        }
    }
    

    Step three is to write an object query pointing to the function:

        using System.Data.Objects;
        protected string ProcessReplacements(Guid versionId, Guid surveyId, string input)
        {
            if (input == null)
                return null;
    
            List<ObjectParameter> parameters = new List<ObjectParameter>(3);
            parameters.Add(new ObjectParameter("VersionId", versionId));
            parameters.Add(new ObjectParameter("SurveyId", surveyId));
            parameters.Add(new ObjectParameter("Input", input));
    
            var output = db.CreateQuery<string>("SurveyDesignerModel.Store.ProcessReplacements(@VersionId, @SurveyId, @Input)", parameters.ToArray())
                .Execute(MergeOption.NoTracking)
                .FirstOrDefault();
    
            return output;
        }
    

    The key for me was the CreateQuery call on the object context and syntax of the “query string”. Notice the fully qualified reference to the function defined in the EDMX, that was my missing link 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have EntityTypes generated from a database using Entity Framework 4. I would like
I have generated entity model from my database which created entity classes. 1) Is
I have an established SQL Server database setup. I then generated an Entity Framework
I'm using Entity Framework Code First to generated my database, so I have an
I have a bunch of entity class (generated by Linq to SQL) with a
I have generated a collection of images. Some of them are blank as in
I have generated entity framework designer classes . After Generating the designer what is
I have several entities generated from my Entity Framework data model. In the .edmx
I have got an Entity model which contains a collection of Message objects which
I am developing using zend framework and doctrine2.1. I have generated entities from database.

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.