Mindscape
  • Register
  • Login
  • YOUR CART IS EMPTY
home
Software
  • Developers Toolbox
  • LightSpeed
  • Raygun
  • WPF Elements
  • Web Workbench
  • Metro Elements
  • Silverlight Elements
  • NHibernate Designer
  • Phone Elements
  • WPF Diagrams
  • Simple DB management
  • Visual Tools for SharePoint
Downloads
Store
  • Buy online
  • Purchase order
  • Volume discounts
  • Reseller
  • Software license
  • Contact sales
Blog
Support
About
  • About Us
  • Contact
  • Testimonials
rss
twitter
facebook
Implementing Storage Policies with LightSpeed Entity Tracking Soft Deletion Timestamps for Entity Tracking and Soft Deletion User Ids for Entity Tracking and Soft Deletion Concurrent Editing Implementing Policies in HandCoded Entities Change Tracking

Entity Tracking

Storing Creation and Update Times

To have LightSpeed automatically store the time when entities of a particular type are created and updated, select the entity and set Track Create Time and/or Track Update Time to true.

The Track Create Time option creates a field named CreatedOn.  LightSpeed automatically populates this field when the entity is first saved.  You can access this field normally and use it in queries.

The Track Update Time option creates a field named UpdatedOn.  LightSpeed automatically populates this field whenever the entity is saved.  As with CreatedOn, you can access this field normally and use it in queries.

The database must contain the corresponding backing columns for whichever options are selected.  If you use Update Database or Create Migration in the designer, it will create these columns for you.  If you create these columns manually, they must be non-nullable columns of date-time type.

Storing Creating and Updating Users

To have LightSpeed automatically store the user who created or last updated entities of a particular type, add CreatedBy and/or UpdatedBy string fields to the entity, and set the LightSpeedContext.AuditInfoMode.

If AuditInfoMode is set, LightSpeed automatically populates the CreatedBy field when the entity is first saved, and automatically updates the UpdatedBy field each time the entity is saved.  Like the timestamp fields, you can access these fields normally and use them in queries.  You should normally mark the fields as Load Only so that application code does not try to modify them.

For compatibility reasons, the CreatedBy and UpdatedBy fields are not used for automatic storage by default: you must enable the policy through the AuditInfoMode.

Because different applications identify users in different ways, the user id written into the CreatedBy and UpdatedBy fields depends on the AuditInfoMode.  See below for further information.

Data Products

  • LightSpeed ORM
  • NHibernate Designer
  • SimpleDB Tools
  • SharePoint Tools

DevOp Tools

  • Raygun

Visual Controls

  • WPF Elements
  • WPF Diagrams
  • Silverlight Elements
  • Phone Elements

Popular Products

  • Web Workbench

    Modern web development for Visual Studio!

  • Mindscape Megapack

    All Mindscape products for one awesome price!

Quick Links

  • Forums
  • Blog
  • Register
  • Login
  • Contact us
  • Twitter
  • Facebook
  • Google+
  • YouTube
  • Linkedin
  • Rss

© Mindscape 2025. Mindscape is a registered trademark of Mindscape Limited.

  • Terms
  • Privacy