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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T02:53:03+00:00 2026-06-17T02:53:03+00:00

For a WCF project I’m working on, I need to implement some kind of

  • 0

For a WCF project I’m working on, I need to implement some kind of audit log for the entities we’re persisting. Basically the audit trail will consist of 4 mandatory fields

  • CreatedDateTime
  • CreatedUserID
  • UpdatedDateTime
  • UpdatedUserID

I’m trying to implement this through nHibernate Event Listeners in my DataAccess layer as I think this should not be in the domain layer. So far, I’ve got the DateTime stuff working as expected, but haven’t been able to figure out how to retrieve the userID in the event listener. Ideally, I would like to have the user id as some sort of custom data attached to the nHibernate session object.

Any suggestion is greatly appreciated.

  • 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-17T02:53:04+00:00Added an answer on June 17, 2026 at 2:53 am

    The .Net framework already has builtin support for contextual user identity information: Thread.CurrentPrincipal http://msdn.microsoft.com/en-us/library/system.threading.thread.currentprincipal.aspx

    Use one of the available IPrincipal implementations or create your own – it’s easy. Then set the property early on, in some “begin-request” method.

    There is also HttpContext.User to be aware of in ASP.NET code.

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

Sidebar

Related Questions

I'm working in a WCF project and we need to reuse some legacy components
I am working on a REST WCF project and when I implement the following
i am working on a wcf project everything went well before an attempt to
When creating a new service in a WCF service project, Visual Studio will automatically
We're about to set off our first larger WCF project, and we're having some
In our WCF project, we are using singleton pattern to obtain client proxy. Basically
I am working on a Silverlight application that uses WCF. I need to have
I am working on a WCF project, which provides business information out of several
I am working on a WCF project that generates and returns a pdf file
In my WCF project I need to use custom headers in responses so I

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.