Convert to new namespace stuff and implicit usings
This commit is contained in:
@@ -1,23 +1,21 @@
|
||||
using System;
|
||||
using System.Security.Cryptography;
|
||||
using System.Security.Cryptography;
|
||||
using MongoDB.Bson.Serialization;
|
||||
|
||||
namespace Prospect.Server.Api.Services.Database.Generator
|
||||
{
|
||||
public class PlayFabIdGenerator : IIdGenerator
|
||||
{
|
||||
private static readonly RNGCryptoServiceProvider Random = new RNGCryptoServiceProvider();
|
||||
|
||||
public object GenerateId(object container, object document)
|
||||
{
|
||||
Span<byte> data = stackalloc byte[8];
|
||||
Random.GetBytes(data);
|
||||
return Convert.ToHexString(data);
|
||||
}
|
||||
namespace Prospect.Server.Api.Services.Database.Generator;
|
||||
|
||||
public bool IsEmpty(object id)
|
||||
{
|
||||
return id is not string idStr || string.IsNullOrEmpty(idStr);
|
||||
}
|
||||
public class PlayFabIdGenerator : IIdGenerator
|
||||
{
|
||||
private static readonly RNGCryptoServiceProvider Random = new RNGCryptoServiceProvider();
|
||||
|
||||
public object GenerateId(object container, object document)
|
||||
{
|
||||
Span<byte> data = stackalloc byte[8];
|
||||
Random.GetBytes(data);
|
||||
return Convert.ToHexString(data);
|
||||
}
|
||||
|
||||
public bool IsEmpty(object id)
|
||||
{
|
||||
return id is not string idStr || string.IsNullOrEmpty(idStr);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user