private static object ApplyFieldBehavior(IPocoDynamo db, DynamoMetadataType type, DynamoMetadataField field, object instance, object value) { if (type == null || field == null || !field.IsAutoIncrement) { return(value); } var needsId = IsNumberDefault(value); if (!needsId) { return(value); } var nextId = db.Sequences.Increment(type.Name); return(field.SetValue(instance, nextId)); }
public virtual Dictionary <string, AttributeValue> ToAttributeKeyValue(IPocoDynamo db, DynamoMetadataField field, object hash) { using (AwsClientUtils.GetJsScope()) { return(new Dictionary <string, AttributeValue> { { field.Name, ToAttributeValue(db, field.Type, field.DbType, hash) }, }); } }