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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T12:19:30+00:00 2026-05-30T12:19:30+00:00

In my Solution I have the following projects MySystem.Core MySystem.Core.Data MySystem.MyAudit1.Core MySystem.MyAudit1.Core.Data MySystem.MyAudit2.Core MySystem.MyAudit2.Core.Data

  • 0

In my Solution I have the following projects

MySystem.Core
MySystem.Core.Data

MySystem.MyAudit1.Core
MySystem.MyAudit1.Core.Data

MySystem.MyAudit2.Core
MySystem.MyAudit2.Core.Data

The number of audit projects could potentially grow to around 20.

The Audit projects all require an “Organisation” reference data table. Rather than duplicate the same reference data table across all audit projects 20 times and try to keep them in sync, my plan is to have a “master” organisation table in the Core project.

This will contain Code and Description for all organisations. Then, in each particular audit project have an OrganisationCode table that contains only the Org Codes relevant to that audit but not the description, and have a view in the audit database that looks up the description from the core Org table as follows:

CREATE VIEW Organisation AS
SELECT d.OrganisationCodeId as 'OrganisationId', d.Code, a.[Description]
FROM MyAudit1.dbo.OrganisationCode d
INNER JOIN [Core].dbo.OrganisationCode a ON d.Code = a.Code

This will mean that if Org descriptions change they can be updated in one place and reflected across all the audits.

However, as you cannot have foreign keys on Views within SQL I had created a foreign key between the OrganisationCode table and whichever other tables in the audit database needs them.

As I have discovered, this of course causes NHibernate to try and return OrganisationCode table rather than the Organisation view and causes my SessionFactory creation to fall over as Nhibernate is looking for OrganisationId in the OrganisationCode table.

Is there an easy way round this which will allow me to have a single description lookup in the core project for reference data that can be used across child projects

  • 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-30T12:19:32+00:00Added an answer on May 30, 2026 at 12:19 pm

    Yes the audit tables are spread over separate dbs, but I have got to the route of my problem.

    The reason that my SessionFactory creation was falling over is that the Configuration was being passed the audit data assembly for mapping, and my organisation mapping file was in the core data assembly.

    Now that I have solved that by adding an organisation mapping file in my audit data assembly, my trust object is returning the description values from the organisation view.

    Thanks for looking.

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

Sidebar

Related Questions

I currently have the following in one solution: Core Project (data access, biz logic,
VS2K8, C#. I currently have a solution with the following projects: Core - POCO
I have a visual studio solution with the following projects: UI DataAccess BusiessLogic BusinessObjects
I have a VS solution, with the following projects. -GUI -DataAccess -BusinessLogic -BusinessObjects but
In my solution I have 4 projects named UI,Business,Data and common.In the Data project
I have a solution with following projects GUI (contains views) ViewModels (contains all view
I have a simple solution with the following projects as follows (base namespaces match
I have a solution file that has the following example projects: SharedLibrary NonSharedLibrary WebProject
I have two projects in a VS 2010 solution: Data and DataForm. In my
Within my main VS solution I have the following 3 projects: The host hosts

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.