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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T11:29:41+00:00 2026-05-22T11:29:41+00:00

I have a set of classes as my domain objects. I have a set

  • 0

I have a set of classes as my domain objects.
I have a set of configuration files to map these objects (EntityTypeConfiguration<>).

When I add a property to any of the domain objects without mapping to a column, the dbcontext attempts to query for the column, ignoring the fact that it is not mapped.

I must be missing a setting either in the configuration code or the dbcontext code. I do not want to add an attribute to the poco class (decorating the pocos tie them to a specific persistence implementation, which I wish to avoid).

On the call against the IQueryable to populate a ticket object, the call fails with the message:

Invalid column name ‘NotInDatabase’.

public class Ticket  
{  
    public Ticket() 
    {
    }

    public virtual int Id
    {
        get;
        set;
    }

    public virtual string Title
    {
        get;
        set;
    }

    public virtual string Description
    {
        get;
        set;
    }

    public string NotInDatabase
    {
        get;
        set;
    }
}


internal class TicketConfiguration : EntityTypeConfiguration<Ticket>  
{   
    public TicketConfiguration()  
    {  
        ToTable("ticket_table_name");

        HasKey(o => o.Id)
            .Property(o => o.Id)
            .HasColumnName("ticketId")
            .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity)
            .IsRequired();

        Property(o => o.Title).HasColumnName("TicketTitle");
        Property(o => o.Description).HasColumnName("TicketDescription");
    }   
}

Note:
Please do not suggest using “Database First” or “Model First” for my situation. I want to map poco objects to the database using the features of code first, even though I have an existing db structure. I am comparing this to nhibernate and really want to stick to a similar structure (since Microsoft “adopted” fluent nhibernate’s approach, it’s pretty easy to compare apples to apples).

Thanks!

  • 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-22T11:29:41+00:00Added an answer on May 22, 2026 at 11:29 am

    .Ignore should do the trick or by attribute it’s called [NotMapped]

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

Sidebar

Related Questions

If have a set of classes that all implement an interface. interface IMyinterface<T> {
Present Scenario : I have a set of classes that all take a common
I have a requirement where in i have a set of classes and they
I'm using ASP.NET MVC RC2. I have a set of classes that were auto-generated
I have a set of callback classes that I use for handling callbacks with
I have a set of some classes which are all capable of being constructored
I have written a set of classes and interfaces that are implemented in Moose
I would love to be able to have a common set of Classes in
I have a set of XSDs from which I generate data access classes, stored
I have a set of core, complicated JavaScript data structures/classes that I'd like to

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.