|
|
|
@ -85,6 +85,14 @@ public static class EntitiesExtensions
|
|
|
|
|
return Serializer.Merge(newEntity, existing, modifier, new StateModifier { State = state }, sources);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static TEntity Clone<TEntity>(this TEntity existing)
|
|
|
|
|
where TEntity : IEntity
|
|
|
|
|
{
|
|
|
|
|
var newEntity = Activator.CreateInstance<TEntity>();
|
|
|
|
|
|
|
|
|
|
return Serializer.Merge(newEntity, existing);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static async Task<ImmutableList<TSource>> AsEntities<TSource>(this IQueryable<TSource> source, CancellationToken cancellationToken = default)
|
|
|
|
|
{
|
|
|
|
|
if (source is null)
|
|
|
|
|