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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T17:13:55+00:00 2026-05-30T17:13:55+00:00

I have a Member entity with a complex type called Address with a complex

  • 0

I have a Member entity with a complex type called Address with a complex type called UsState which has the following properties: Id, Name and Iso.

I need to map the Member Address’s UsState to its DB table column. The problem is that members table only contains State (VARCHAR) column, so in order to perform the right mapping, I did this:

modelBuilder.Entity<Member>().Property(p => p.BillingAddress.State.Name).HasColumnName("State");
modelBuilder.Entity<Member>().Ignore(p => p.BillingAddress.State.Id);
modelBuilder.Entity<Member>().Ignore(p => p.BillingAddress.State.Iso);

But it appears that Ignore only accepts base property lambdas, so I received this:

The expression 'p => p.BillingAddress.State.IsoCode' is not a valid property expression. The expression should represent a property: C#: 't => t.MyProperty'  VB.Net: 'Function(t) t.MyProperty'.

How can I resolve this issue? (preferably using Ignore method)

  • 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-30T17:13:56+00:00Added an answer on May 30, 2026 at 5:13 pm

    Create a sublcass of UsState

    public class UsStateSpecific : UsState
    {
    }
    

    Then change the type of the State property in BillingAddress‘s type to UsStateSpecific.

    public class Address 
    {
    ...
    public UsStateSpecific State
    ...
    }
    

    Now ignore all desired properties from complex type (or entity) UsStateSpecific. This will not affect your other UsState properties in other types.

    modelBuilder.ComplexType<UsStateSpecific>().Ignore(p => p.Id);   
    modelBuilder.ComplexType<UsStateSpecific>().Ignore(p => p.Iso);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have entity Businesses Reviews Reviewers Each entity has a member called rating.
My User entity class have several member variables (e.g. String firstName) which are persisted
I have a JPA 2 Entity named Surgery . It has a member named
I have 3 entities: RatedPrice, DailyPrice and UtilizePrice. Each entity has Code member. I
I have two entity sets with entities of the same name with properties of
I have this entity - I'm trying to determine the type of its properties
I have a Group Entity with the following class member and mapping: /** *
I have a member function in a class that has a callback, but the
I have the following member of class foo. foo &foo::bar() { return this; }
I have the following class/entity: public class Product : ISaleable { public void ProcessSale()

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.