src/EasyProfiler.EntityFrameworkCore/Generators/GuidGenerator.cs
using System;
using Microsoft.EntityFrameworkCore.ChangeTracking;
using Microsoft.EntityFrameworkCore.ValueGeneration;
namespace EasyProfiler.EntityFrameworkCore.Generators
{
/// <summary>
/// Guid value generator for primary key.
/// </summary>
public class GuidGenerator : ValueGenerator
{
public override bool GeneratesTemporaryValues => false;
protected override object NextValue(EntityEntry entry)
{
return Guid.NewGuid();
}
}
}