Set default value of a GUID field in Entity Framework Sqlite vs MsSql


protected override void OnModelCreating(ModelBuilder modelBuilder)
{
   modelBuidler.Entity<MyEntity>(entity => 
      if (_settings.UseSql) 
      {
         entity.Property(e => e.Id)
            .HasColumnName("id")
            .HasDefaultValueSql("(newid())");
      }
      else if (_settings.UseSqlite)
      {
         entity.Property(e => e.Id)
            .HasColumnName("id")
            .HasDefaultValue(Guid.NewGuid());
      }
      ....
}