Ejemplo n.º 1
0
        /// <summary>
        /// Creates or updates record in DynamoDB
        /// </summary>
        /// <param name="resource"></param>
        /// <returns></returns>
        private async Task <dynamic> CreateOrUpdate(dynamic resource)
        {
            await(await Table(resource.Type)).PutItemAsync(DynamoDbDocumentHelper.ToDocument(resource));

            return(await Get(resource.Type, resource.Id));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates or updates record in DynamoDB
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="resource"></param>
        /// <returns></returns>
        private async Task <T> CreateOrUpdate <T>(dynamic resource) where T : Resource, new()
        {
            await(await Table(typeof(T))).PutItemAsync(DynamoDbDocumentHelper.ToDocument(resource));

            return(await Get <T>(resource.Id));
        }