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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:48:38+00:00 2026-06-03T00:48:38+00:00

In the Simple.Data examples, there is an example of ‘Magic Casting’: // When you

  • 0

In the Simple.Data examples, there is an example of ‘Magic Casting’:

// When you assign the dynamic record to a static type, any matching properties are auto-mapped.
var db = Database.Open();
Customer customer = db.Customers.FindByCustomerId(1);

Does Simple.Data also magically cast if there are multiple records returned? Something like this:

var db = Database.Open();
IEnumerable<Customer> customers = db.Customers.FindBySurname("Smith");

Obviously I have tried the above and it doesn’t work (“Cannot implicitly convert type” from SimpleQuery to my concrete type). Any advice would be welcome.

  • 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-03T00:48:39+00:00Added an answer on June 3, 2026 at 12:48 am

    FindBySurname returns a single record. If you use FindAllBySurname you’ll get an enumerable, which should magic cast OK. (If for some reason it doesn’t, you can call .Cast() on it.)

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

Sidebar

Related Questions

are there any simple examples you know of that demonstrate how a python program
Using images with Core Data isn't a problem. There are a lot of examples
Are there any open-source examples of ASP.NET MVC applications that use the Entity Framework?
Searching turns up a simple definition: data hiding. But, consider the following two examples:
Consider following two examples: Example 1: <xs:import namespace=http://example.com/ns schemaLocation=test.xsd/> Example2: <sample:Data Test=true xsi:schemaLocation=http://example.com/test.xsd> How
I have a simple data model of two tables, email and recipients, email can
My application has a simple data model with 70 read-only records grouped into six
I'm writing a simple data UI using standard .Net databinding to a typed DataSet
I have only simple data types in method signature of service (such as int,
Given a simple data set, I would like to be able to calculate 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.