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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:40:18+00:00 2026-06-17T20:40:18+00:00

I have a Task entity with various navigation properties, including a Comment entity: public

  • 0

I have a Task entity with various navigation properties, including a Comment entity:

public Comment { 
  public int ID { get; set; }
  public string Title { get; set; }
  public string Description { get; set; }
  public DateTime CreateDate { get; set; }
  public DateTime LastEditedDate { get; set; }
  public virtual User User { get; set; }
}

A comment can be edited, and I want to keep a history of all such changes. Think of the way Stackoverflow allows you to edit your questions/comments, but keeps a history of changes.

Keeping a history means more complexity, and it becomes harder to maintain. My options:

  • add properties such as public virtual ICollection<string> DescriptionHistory { get; set; }, and a similar one for Title, User, EditDate, etc. It gets out of hand very quickly.

  • keep the Title, Description, etc. properties as strings, but make them CSV strings and stuff all those changes into a fewer set of properties. This means more processing, but the entity is simpler. The problem is that it becomes tricky to associate one CSV fragment with the corresponding one from a different property, eg a historical title must match its historical description and date.

  • do both, have the current set of properties, and another single set of nullables like TitleHistory, DescriptionHistory, etc., which are CSV strings of older versions, and so it only gets complicated when you are dealing with the historical stuff.

Also there are problems around the storage of the user, unless I use a CSV of IDs rather than the entities.

What is the best approach to this problem? There are various techniques such as sprocs and “insert only” tables – but I am using Entity Framework 5, and so prefer a solution which leverages the technology I am already using.

  • 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-17T20:40:19+00:00Added an answer on June 17, 2026 at 8:40 pm

    I’ve settled on using an “insert only” table. Pity it’s not easy to do with EF5.

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

Sidebar

Related Questions

I have an entity Quest which contains many Task s: @Entity public class Quest
I have got these POCO classes: public class Task { public int TaskId {
I have Employee table and an Entity class for it, My task is such
I have an entity called Task in my Core Data model. The Task entity
my current project is based on Entity Framwork code-first. I have three types: Task,
I have an Activity which provides UI for editing entity properties such as name,
I have a Core Data model in which a Task entity includes an optional
I have: Task Entity that holds a foreignkey to a Project Entity. In the
I have a Activity entity, this entity can have several Task. Here the code
Let's say I have a 1D-like table like this: TBL_1 [ Task ][ Entity

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.