Skip to content
This repository has been archived by the owner on Nov 10, 2017. It is now read-only.

Where is the mapped class for Cognito (like DynamoDB has), and what should we do if no connection initially? #33

Closed
seaders opened this issue Mar 12, 2015 · 2 comments

Comments

@seaders
Copy link

seaders commented Mar 12, 2015

In the developer guide for DynamoDB for .NET, http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ArbitraryDataMappingHLAPI.html, you're able to create a mapped DynamoDB class incredibly easily like,

[DynamoDBTable("ProductCatalog")]
public class Book
{
    [DynamoDBHashKey]   // hash key
    public int Id { get; set; }

    [DynamoDBProperty]
    public string Title { get; set; }

    [DynamoDBProperty]
    public string ISBN { get; set; }
    // Multi-valued (set type) attribute. 

    [DynamoDBProperty("Authors")]
    public List<string> BookAuthors { get; set; }

    // Arbitrary type, with a converter to map it to DynamoDB type.
    [DynamoDBProperty(typeof(DimensionTypeConverter))]
    public DimensionType Dimensions { get; set; }
}

Which, while incredibly useful for DynamoDB, to me, that would make a whole lot more sense for a Cognito backed class, something like,

[CognitoDataset("ProductCatalog")]
public class Book
{
    [CognitoProperty]
    public int Id { get; set; }

    [CognitoProperty]
    public string Title { get; set; }

    [CognitoProperty]
    public string ISBN { get; set; }
    // Multi-valued (set type) attribute. 

    [CognitoProperty("Authors")]
    public List<string> BookAuthors { get; set; }

    // Arbitrary type, with a converter to map it to DynamoDB type.
    [CognitoProperty(typeof(DimensionTypeConverter))]
    public DimensionType Dimensions { get; set; }
}

Or similar. Reason I'm saying this is because I've basically written a kind of custom version of this already, because I didn't think this existed within your SDK already, but seeing it for DynamoDB, but not Cognito doesn't make a whole lot of sense to me.

And my second question. In testing, if you turn off network connectivity the very first time, you don't have access to a Dataset to store anything. We plan on having a Cognito Dataset as the complete backend of a user's profile, whether they're online, or offline (obviously they can only sync when online), but I'm completely confused as to what to do if they don't have a network connection the very first time they launch the app, before they've even a cached cognito id.

@ghost
Copy link

ghost commented Mar 13, 2015

Yes, the similar feature is not in Cognito now. Thank you for your feedback. Your suggestion does help us prioritize our work. We are considering this feature.

@karthiksaligrama
Copy link
Contributor

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants