Implement gRPC on client and server
Pending Testing
This commit is contained in:
15
AobaServer/Utils/Extensions.cs
Normal file
15
AobaServer/Utils/Extensions.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using MongoDB.Bson;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user