#amazon-web-services #unity3d #amazon-dynamodb
#amazon-веб-сервисы #unity3d #amazon-dynamodb
Вопрос:
Я работаю в DyanmoDB.В моем проекте я должен динамически задавать имя базы данных и динамически загружать базу данных. Это мой код
using UnityEngine; using System.Collections; using Amazon.DynamoDBv2.DataModel; using System.Collections.Generic; using Amazon.DynamoDBv2; using UnityEngine.UI; using UnityEngine; using System.Collections; using Amazon.DynamoDBv2; using UnityEngine.UI; using Amazon; namespace AWSSDK.Examples { public class HighLevel3 : DynamoDbBaseExample { private IAmazonDynamoDB _client; private DynamoDBContext _context; public Text resultText; public Button back; public Button createOperation; public Button updateOperation; public Button deleteOperation; public string S_tablefieldset; string bookID; int bookID1 = 9; public string Email; private DynamoDBContext Context { get { if (_context == null) _context = new DynamoDBContext(_client); return _context; } } void Awake() { back.onClick.AddListener(BackListener); createOperation.onClick.AddListener(PerformCreateOperation); _client = Client; S_tablefieldset = "Orders"; HighLevelTableExample.GetDynamoDbOperationConfig(S_tablefieldset); } void Start() { bookID = SystemInfo.deviceUniqueIdentifier; System.Environment.SetEnvironmentVariable("MONO_REFLECTION_SERIALIZER", "Orders"); PerformCreateOperation(); } public static DynamoDBOperationConfig GetDynamoDbOperationConfig(string dynamoDbTable) { Debug.Log("The Table name is " dynamoDbTable); var tableName = System.Environment.GetEnvironmentVariable("MONO_REFLECTION_SERIALIZER"); Debug.Log("The Table name is" tableName); DynamoDBOperationConfig config = new DynamoDBOperationConfig() { // OverrideTableName = OverrideTableName = tableName }; return config; } public void PerformCreateOperation() { Debug.Log(" I am in Perform Create Operation is working fine and good"); Book12 myBook = new Book12 { OrderID = bookID, OrderItem = 50, }; // Save the book. var tableName = System.Environment.GetEnvironmentVariable("TABLE_NAME"); Context.SaveAsync(myBook, new DynamoDBOperationConfig { OverrideTableName = tableName }); } }
публичный учебник12 {
[DynamoDBHashKey] // Hash key. public string OrderID { get; set; } [DynamoDBProperty] public string UserName { get; set; } [DynamoDBProperty] }
}
При выполнении вышеизложенного я получил ошибку в
error CS1503: Argument 2: cannot convert from
-Амазонка.DynamoDBv2.Модель данных.DynamoDBOperationConfig’ для Амазонка.DynamoDBv2.AmazonDynamoDBCallback’
Как устранить ошибку.