Comments (3)
no i had trouble with regular record
s but I wrote them with constructor properties like this
[DynamoDBTable("actors", lowerCamelCaseProperties:true)]
public record ActorRole(
[property: DynamoDBHashKey("actor")] string Name,
string Movie,
string Role,
DateTime LastUpdated);
from aws-sdk-net.
Per Create record types, Records are types that use value-based equality. This is opposite of class types which use reference based equality. Unsure if record types would fit into object based model. Needs review with the team.
from aws-sdk-net.
Is it record struct
support that you're interested in? I do see those getting stopped in our CanInstantiateHelper
:
This seemed to work for me for record class
, though didn't test exhaustively.
[DynamoDBTable("actors", lowerCamelCaseProperties:true)]
public record class ActorRole
{
[DynamoDBHashKey("actor")]
public string Name { get; set; }
public string Movie { get; set; }
public string Role { get; set; }
public DateTime LastUpdated { get; set; }
}
static async Task Main(string[] args)
{
var client = new AmazonDynamoDBClient();
IDynamoDBContext context = new DynamoDBContext(client);
var actor = await context.LoadAsync<ActorRole>("Tom Hanks", "Toy Story");
Console.WriteLine(actor.Role);
actor.LastUpdated = DateTime.UtcNow;
await context.SaveAsync(actor);
var document = context.ToDocument<ActorRole>(actor);
foreach (var value in document)
{
Console.WriteLine(value.Key + " " + value.Value);
}
var query = context.QueryAsync<ActorRole>("Tom Hanks");
foreach (var item in await query.GetRemainingAsync())
{
Console.WriteLine(item.Name + " " + item.Movie + " " + item.LastUpdated);
}
}
from aws-sdk-net.
Related Issues (20)
- DynamoDB AttributeValue roundtrip of empty number or string sets HOT 13
- V4 Development: General strategy on how to fill in missing APIs HOT 5
- TransferUtility does not support downloading objects in Requester Pays buckets. HOT 10
- DisableFetchingTableMetadata leads to key exception if PropertyConverter is used HOT 3
- `region` set in profile in `$HOME/.aws/config` is ignored HOT 12
- TransferUtilityUploadRequest.UploadProgressEvent event not firing HOT 10
- V4 Development: TargetFrameworks HOT 2
- V4 Development: Sensible LangVersion
- Null QueueUrl when using LocalStack HOT 3
- DisableFetchingTableMetadata leads to InvalidOperationException if PropertyConverter is used HOT 6
- AWSSDK.S3 ListObjectsV2 API returns Size incorrectly every other request for some subset of files +/- 2 bytes HOT 6
- V4 Development: DefineConstants requires an overhaul HOT 1
- AmazonS3Client.PutObjectAsync does not retry with HttpClient HttpCompletionOption.ResponseHeadersRead when using devproxy HOT 5
- Amazon.CloudWatch.Model.MetricDatum timestamp is not set correctly HOT 3
- connectCases:Add retry if created customer or case is not immediately available HOT 6
- Unable to use S3 Path Style Access S3 URL HOT 3
- Cannot Get DynamoDB record when model inherits from base class with member with the same name HOT 8
- Unable to connect to Timestream from using endpoint (.Net) HOT 3
- DynamoDB SDK convert Nullable DateTime to Local HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aws-sdk-net.