Files
AobaV2/AobaServer/Utils/Extensions.cs
Amatsugu e223612a08 Auth rpc
Search Bar
Search requests
2025-05-03 22:21:11 -04:00

19 lines
315 B
C#

using MongoDB.Bson;
using MongoDB.Driver;
namespace AobaServer.Utils;
public static class Extensions
{
public static ObjectId ToObjectId(this string? value)
{
if(value == null)
return ObjectId.Empty;
if(ObjectId.TryParse(value, out ObjectId result))
return result;
return ObjectId.Empty;
}
}