Convert to new namespace stuff and implicit usings

This commit is contained in:
AeonLucid
2022-01-07 06:07:05 +01:00
parent ce2ea7f295
commit 2f01cf7411
85 changed files with 2538 additions and 2696 deletions
@@ -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);
}
}