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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:08:47+00:00 2026-05-26T01:08:47+00:00

I have a script running every hour that stores log data in a logging

  • 0

I have a script running every hour that stores log data in a logging database. Every month a new table is created, and the logging information from this month is stored in that table.

Every table that is created is identical and match a simple POCO class

class IISLog
{
  SystemRef,
  date,
  s-sitename,
  //etc
 }

I’ve only found a single way to access these tables using a code-first approach:

 var result = this.Database.SqlQuery<WebLog>("select * from " + table + "_" + month);

However, it appears that I lose the lazy loading in the process since SqlQuery returns an IEnumerable of the type.

Is there any way to let lazy loading prevail as well as allow the data context to track the elements? (Main priority on the first point).

  • 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-26T01:08:47+00:00Added an answer on May 26, 2026 at 1:08 am

    You will lose everything by using SqlQuery – that is direct SQL execution without any EF features involved. It will just materialize objects for you.

    There is no way to use EF with this type of database tables. EF demands that type can be mapped only to single table (or set of tables in case of inheritance or splitting). Entity cannot be mapped to multiple tables even if they are exactly same.

    If you want to use EF you should look for solution on database side and map only single database view or table to your entity or use stored procedure to correctly select table which will be queried.

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

Sidebar

Related Questions

I have a small script that launches and, every half hour, feeds a command
I have a PHP script (running on a Linux server) that ouputs the names
I have a PHP script running on XAMPP in Windows XP that will open
I have a Perl/POE/Tk script running on Win32 ActivePerl that calls executables using system
I have a php script that is running in CLI and I want to
I have a Python script that is running a few ls commands. This script
I have a script that I'm running from the home directory to search for
I have a script that is supposed to sit there, happily running in a
I have a cron job running a PHP script every five minutes; the PHP
I have a PHP script that I need to run every minute. I have

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.