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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:22:30+00:00 2026-05-31T22:22:30+00:00

In my model, I have two tables with a 1:0..1 relationship between them: (Example

  • 0

In my model, I have two tables with a 1:0..1 relationship between them:

(Example names for the sake of simplicity)

Event
----------
EventId (int; PK)
StartDate (date)
EndDate (date)

EventTime
---------
EventId (int; PK, FK)
StartTime (time)
EndTime (time)

(As this is 6NF, none of these columns are nullable)

In my edmx, I’m trying to map these two tables into a single entity where StartTime and EndTime are null on the entity, but not in the database. While this doesn’t strictly represent what’s possible in the database (the database would require either valid values for both start and end time, or no value for either), I was hoping to have EF make the decision as to whether or not an EventTime row needed to exist depending on whether or not the StartTime and EndTime values were set on the entity, and throw an exception if only one was set.

It doesn’t seem that this is possible, at least how I have it configured. I added two scalar properties to the Event class and mapped them to the EventTime table. The mapping was created successfully, but when I try to compile my precompiled views I get the following compiler error:

Error   108 Running transformation: Problem in mapping fragments starting at line 0:Non-nullable column EventTime.EndTime in table EventTime is mapped to a nullable entity property.

Obviously, I can deal with the EventTime entity as a distinct entity (as it actually is in the database), but I was hoping to simplify the API surface by doing it this way. Is what I’m shooting for possible?

  • 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-31T22:22:32+00:00Added an answer on May 31, 2026 at 10:22 pm

    Given the lack of response to this question, I am going to assume that it is not possible.

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

Sidebar

Related Questions

I have two models Property and Amenity the relationship between them is many to
I have a many-to-many relationship between two tables: Order and Item. I need to
I have two tables with a join table between them: Parent: Pages Child: Things
I have two tables related: DataEntered and Model DataEntered -currentModel Model One DataEntered can
I have two tables that are considered a single entity in my domain model.
I have two tables: Client(id,name,...) Purchase(id,item,date,client_id,...) They have their respective Model, with their validations.
I have two tables, one Company and one Employee: class Company(models.Model): name = models.CharField(max_length=60)
Here is a simplified version of my database model. I have two tables: Image,
I have a simple data model of two tables, email and recipients, email can
I have the following two models: School and User, and a HABTM relationship between

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.