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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:21:31+00:00 2026-06-13T06:21:31+00:00

I am new to LINQ and OrmLite/MySql. I have a service request argument that

  • 0

I am new to LINQ and OrmLite/MySql. I have a service request argument that needs to result in a where clause:

`Name` LIKE '%something%' OR `Name` LIKE '%something%else%'

I know I can create an IN() or an = clause, via:

ev.Where(rn => Sql.In(rn.Name, request.Name));  // Assuming an array here
ev.Where(rn => rn.Name== request.Name));

But I can’t seem to find a construct that lets me build up a LIKE. Also, Name is actually an alias so I am trying to avoid constructing the where clause manually.

  • 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-06-13T06:21:33+00:00Added an answer on June 13, 2026 at 6:21 am

    You can build that particular example using Contains, i.e:

    ev.Where(rn => rn.Contains(rn.Name, "something") 
        || rn.Contains(rn.Name, "something%else"));
    

    StartsWith and EndsWith are generally used in LINQ to generate LIKE clauses with a wildcard at only one end (but it does appear the MySql dialect defines StartsWith somewhat differently, likely for efficiency.)

    You can check the default dialect source code to confirm what gets generated for EndsWith and Contains.

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

Sidebar

Related Questions

I have a mapping that looks like this: <class name=Record> <map name=Values> <key column=RecordFK/>
I am new with Linq and I would like to sort some data that
Im new to linq so i still struggle .... I have a collection of
I am somewhat new to LINQ and have a quick question regarding deleting. Say,
I am new to linq and linq2SQL. I have done my homework, i.e. found
I am new to Linq to Entities, and have no idea how to make
I am new to LINQ and have become stumped on the translating the following
I'm new to linq and I'm trying to write an update statement. I have
I have code which parses XML that looks like this: <custom_fields> <custom_field> <column_name>foo</column_name> <column_value>0</column_value>
Im new to linQ and I've got a problem Question: if i have a

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.