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 6867769
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:21:03+00:00 2026-05-27T03:21:03+00:00

I would like to be able to use Full text search in Code First

  • 0

I would like to be able to use Full text search in Code First Entity Framework. However this is not the only SQL specific function the team I’m in will be likely to use in the future.

I know that Code First isn’t supposed to do database specific stuff or UDFs.

However if I can’t get this working I will have slow queries. I want to be able to search through a large number of records (millions) based on a number of criteria including date ranges, partial text search and boolean fields.

So ideally I would be able to on the fly change the name of the table that a particular DataSet ends up querying to be dbo.GetMyEntityName(queryString). I don’t think there is a way to do this, I thought of replacing it before it was sent to the sql server but even I managed that I would have to know which reference to the table it was.

I tried looking into how EFProviderWrappers handles it, but it doesn’t handle code first very well and I really don’t have the spare time at the moment to write a new version for Code First. I don’t know if it is even possible which part of the command to replace in there, I wasn’t able to get it working at all. Although I didn’t try running it with an edmx.

The other thing I thought of was using the IQueryable.ToString method which for my DbQueries return SQL wrapping that with a select * from ({0}) where {1} and then executing it using Context.Database.SqlQuery the problem with that entity framework was confused between my ViewModels and my Domain objects because in some cases they had similar or the same name.

Another solution was to Register a search/replace with a custom SqlConnection, so once it’s registered, the next select gets edited, so something like [dbo].[MyEntity] gets replaced with [dbo].GetMyEntity('query'). However that’s very limited, if you wanted to refer to the same table multiple times in the same query then it would replace both, the first or the last… which isn’t very flexible. If I could find out how it decides to alias these tables then it would be very easy to do this method.

Any ideas would be greatly appreciated.

  • 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-27T03:21:04+00:00Added an answer on May 27, 2026 at 3:21 am

    Seriously. The idea is not using EF in such situation – use SQL directly because you knows name of your tables (you are defining the mapping). As you can see EF has serious disadvantages in your scenario because it is targeted to smaller (less performance) critical applications.

    This immaturity gap can be improved after .NET 4.5 release where table-valued functions will be supported directly (but only when using EDMX).

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

Sidebar

Related Questions

I would like to be able to use the Tab key within a text
This is really just for my own use: I would like to be able
I would like to be able to use the same Session variable when transferring
I'm writing a component that I would like to be able to use in
I'm new to the iPhone and I would like to be able to use
I would like to be able to define and use a custom type in
I would like to be able to display some dynamic text at the mouse
I am creating a Cassandra database and would like full-text indexing and searching on
Would like to be able to set colors of headings and such, different font
I would like to be able to loop through all of the defined parameters

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.