aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.DAL.Observables/ExtensionMethods/ObservableEntityExtensions.cs
blob: eb7e6efb9c4363614f8e99f18346edf3e07941fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.DAL.Observables;

public static class ObservableEntityExtensions
{
    public static T CloneEntity<T>(this T entity) where T : class, IObservableEntity
    {
        T cloned = entity.ShallowClone();
        cloned.Guid = Guid.NewGuid().ToString();
        cloned.LastUpdated = DateTime.UtcNow;
        return cloned;
    }
}