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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T21:22:16+00:00 2026-06-01T21:22:16+00:00

I have a problem with a TPH mapping. Here are the classes : Abstract

  • 0

I have a problem with a TPH mapping.
Here are the classes :

Abstract service (base class)

[Table("Services")]
public abstract class AbstractService : IAuditedObject
{
    public int Id { get; set; }

    [DisplayName("Receiver Site")]
    public int? TargetSiteId { get; set; }
    [DisplayName("Receiver Site")]
    public virtual Site TargetSite { get; set; }

    [DisplayName("Start Date")]
    public PartialDate StartDate { get; set; }
    [DisplayName("End Date")]
    public PartialDate EndDate { get; set; }

    [DisplayName("Study")]
    public int? StudyId { get; set; }
    [DisplayName("Study")]
    public virtual Study Study { get; set; }
}

Concrete services

public class AssociatedStaffService : AbstractService
{
    [DisplayName("Person")]
    [Required]
    public int? SourcePersonId { get; set; }
    [DisplayName("Person")]
    public virtual Person SourcePerson { get; set; }

    [DisplayName("Service")]
    [Required]
    public int? RoleId { get; set; }
    [DisplayName("Service")]
    public virtual AssociatedStaffServiceCLI Role { get; set; }

    [DisplayName("Department")]
    public string Department { get; set; }

    public bool IsActive()
    {
        return this.SourcePerson != null && this.TargetSite != null && this.SourcePerson.IsActive() && this.TargetSite.IsActive() && this.Study != null && (this.EndDate == null || this.EndDate.Date == null || this.EndDate.Date > DateTime.Now);
    }
}

public class EthicCommitteeService : AbstractService
{
    [DisplayName("Site")]
    [Required]
    public int? SourceSiteId { get; set; }
    [DisplayName("Site")]
    public virtual Site SourceSite { get; set; }

    [DisplayName("Central")]
    public bool? IsCentral { get; set; }

    public bool IsActive()
    {
        return this.Study != null && this.TargetSite != null && this.SourceSite != null && this.TargetSite.IsActive() && this.SourceSite.IsActive() && (this.EndDate == null || this.EndDate.Date == null || this.EndDate.Date > DateTime.Now);
    }
}

public class ParticipatingService : AbstractService
{
    public const string AUTHORIZATION_DATE = "AuthorizationDate";
    public const string IS_NATIONAL_COORDINATOR = "IsNationalCoordinator";

    [DisplayName("Person")]
    [Required]
    public int? SourcePersonId { get; set; }
    [DisplayName("Person")]
    public virtual Person SourcePerson { get; set; }

    [DisplayName("Service")]
    [Required]
    public int? RoleId { get; set; }
    [DisplayName("Service")]
    public virtual ParticipatingServiceCLI Role { get; set; }

    [DisplayName("Department")]
    public string Department { get; set; }

    public int? RegInvestigatorFormId { get; set; }
    public PartialDate AuthorizationDate { get; set; }
    public bool? IsNationalCoordinator { get; set; }

    public bool IsActive()
    {
        return this.SourcePerson != null && this.TargetSite != null && this.SourcePerson.IsActive() && this.TargetSite.IsActive() && this.Study != null && (this.EndDate == null || this.EndDate.Date == null || this.EndDate.Date > DateTime.Now);
    }
}

public class ExternalService : AbstractService
{
    [DisplayName("Person")]
    [Required]
    public int? SourcePersonId { get; set; }
    [DisplayName("Person")]
    public virtual Person SourcePerson { get; set; }

    [DisplayName("Service")]
    [Required]
    public int RoleId { get; set; }
    [DisplayName("Service")]
    public virtual ExternalServiceCLI Role { get; set; }

    [DisplayName("Department")]
    public string Department { get; set; }

    public bool IsActive()
    {
        return this.SourcePerson != null && this.TargetSite != null && this.SourcePerson.IsActive() && this.TargetSite.IsActive() && this.Study != null && (this.EndDate == null || this.EndDate.Date == null || this.EndDate.Date > DateTime.Now);
    }
}

public class StudyTeamService : AbstractService
{
    [DisplayName("Person")]
    [Required]
    public int? SourcePersonId { get; set; }
    [DisplayName("Person")]
    public virtual Person SourcePerson { get; set; }

    [DisplayName("Service")]
    [Required]
    public int? RoleId { get; set; }
    [DisplayName("Service")]
    public virtual StudyTeamServiceCLI Role { get; set; }

    [DisplayName("Department")]
    public string Department { get; set; }

    public bool IsActive()
    {
        return this.SourcePerson != null && this.TargetSite != null && this.SourcePerson.IsActive() && this.TargetSite.IsActive() && this.Study != null && (this.EndDate == null || this.EndDate.Date == null || this.EndDate.Date > DateTime.Now);
    }
}

I always get the following error :

— ERROR: One or more validation errors were detected during model generation:

    System.Data.Edm.EdmProperty: Name: Each property name in a type must be unique. Property name 'StartDate' is already defined.
    System.Data.Edm.EdmProperty: Name: Each property name in a type must be unique. Property name 'EndDate' is already defined.  ---

And here is the stack trace :

Unhandled Exception:
System.Data.Entity.ModelConfiguration.ModelValidationExcept ion: One
or more validation errors were detected during model generation:

    System.Data.Edm.EdmProperty: Name: Each property name in a type must be unique. Property name 'StartDate' is already defined.
    System.Data.Edm.EdmProperty: Name: Each property name in a type must be unique. Property name 'EndDate' is already defined.

at Prisma.Loader.PrismaLoader.Init() in
C:\Projects_PrismaLoader\Prisma.Load er\PrismaLoader.cs:line 95 at
Prisma.Loader.PrismaLoader.Load(Boolean quick) in
C:\Projects_PrismaLoade r\Prisma.Loader\PrismaLoader.cs:line 32 at
Prisma.Loader.Program.Main(String[] args) in
C:\Projects_PrismaLoader\Pri sma.Loader\Program.cs:line 113

Stack trace is not really useful in this case (it seems…)

Does anyone has an idea where I’ve made a mistake ? I’ve been searching for a day now…

  • 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-01T21:22:18+00:00Added an answer on June 1, 2026 at 9:22 pm

    Resolved

    It seems that the problem was the PartialDate class. It has to be annotated with the [ComplexType] annotation.

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

Sidebar

Related Questions

i have problem with enum I need make a enum in base class or
I have problem with deleting rows from table. I have a class for cell
i have problem with autorotate on iphone i set up in all classes -
I have problem with deserialize document to object using XmlSerializer class. Code my function
I have problem in C#. I have a list box and a class called
I have problem with add new row to the table. I use Google Maps,
I have problem in some JavaScript that I am writing where the Switch statement
I have problem with return statment >.< I want to store all magazine names
I have problem with starting processes in impersonated context in ASP.NET 2.0. I am
I have problem compilin this code..can anyone tell whats wrong with the syntax CREATE

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.