Support DateTimeOffset datatype for auditing fields

1
Voted

Hi guys,

With the advent of cloud hosting and software-as-a-service products, we're finding it increasingly necessary to make sure our databases are portable across environments and specifically timezones. To that end we are looking to make use of System.DateTimeOffset and the equivalent DateTimeOffset SQL datatype.

However Lightspeed doesn't currently allow any datatype other than System.DateTime and the DateTime SQL datatype for the Lightspeed maintained auditing fields (CreatedOn, UpdatedOn, DeletedOn).

It would be great if you could extend the current customisation options to allow the specification of alternate datatypes for these fields. Maybe something along the lines of:

// Maintain the existing IAutoTimeStampStrategy for backwards compatibility
public interface IAutoTimeStampStrategy : IAutoTimestampStrategy<DateTime>
{   
}

// Introduce new generic interface that defines the datatype by way of a generic parameter
public interface IAutoTimeStampStrategy<TTime>
{   
      TTime GetTime();
}

Thanks, Greg

Status: New