초기커밋
This commit is contained in:
38
BrokerApiTest/DocQuery/UserTestFindOneAction.cs
Normal file
38
BrokerApiTest/DocQuery/UserTestFindOneAction.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using ServerCommon;
|
||||
|
||||
using ServerCore; using ServerBase;
|
||||
|
||||
public class UserTestFindOneAction : EntityActionBase
|
||||
{
|
||||
public UserTestFindOneAction(UserTestEntity owner) : base(owner)
|
||||
{
|
||||
}
|
||||
|
||||
public override async Task<Result> onInit()
|
||||
{
|
||||
var result = new Result();
|
||||
return await Task.FromResult(result);
|
||||
}
|
||||
|
||||
public override void onClear()
|
||||
{
|
||||
}
|
||||
|
||||
public async Task<(Result, UserTestDoc?)> findUserOne(string userId, DynamoDbClient dynamoDbClient)
|
||||
{
|
||||
ArgumentNullReferenceCheckHelper.throwIfNull(dynamoDbClient,
|
||||
() => $"dynamoDbClient is null !!! - {getOwner().toBasicString()}");
|
||||
var doc = new UserTestDoc(userId);
|
||||
var (result, result_doc) = await doc.findOne(dynamoDbClient);
|
||||
return (result, result_doc);
|
||||
}
|
||||
|
||||
public async Task<(Result, UserTestDoc?)> findUserOne2(string userId, DynamoDbClient dynamoDbClient)
|
||||
{
|
||||
ArgumentNullReferenceCheckHelper.throwIfNull(dynamoDbClient,
|
||||
() => $"dynamoDbClient is null !!! - {getOwner().toBasicString()}");
|
||||
var config = dynamoDbClient.makeQueryConfigForReadByPKOnly(userId);
|
||||
var (result, doc) = await dynamoDbClient.simpleQueryDocTypeWithQueryOperationConfig<UserTestDoc>(config);
|
||||
return (result, doc);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user