Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rough and ready prototype of custom serialization #2663

Closed

Conversation

jskeet
Copy link
Collaborator

@jskeet jskeet commented Nov 6, 2018

This is to demonstrate one possible approach to #2534.

This is to demonstrate *one* possible approach to googleapis#2534.
@jskeet jskeet self-assigned this Nov 6, 2018
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Nov 6, 2018
}

[FirestoreData(Converter = typeof(EmailConverter))]
public sealed class Email

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

public string Name { get; set; }

[FirestoreProperty]
public Email Email { get; set; }

This comment was marked as spam.

This comment was marked as spam.

Copy link
Collaborator Author

@jskeet jskeet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the comments. I'm pretty sure we want to be able to separate converter from the model itself. (All serialization approaches I've seen which are based on the model implementing the interface end up being painful with respect to immutability, at the very least.)

I think we need to discuss requirements and implementation options around the MailAddress and "shared model" scenarios. (Is the latter even a scenario which is wanted, for example?)

public string Name { get; set; }

[FirestoreProperty]
public Email Email { get; set; }

This comment was marked as spam.

}

[FirestoreData(Converter = typeof(EmailConverter))]
public sealed class Email

This comment was marked as spam.

@jskeet
Copy link
Collaborator Author

jskeet commented Nov 26, 2018

Closing this now as the real implementation is on the way.

@jskeet jskeet closed this Nov 26, 2018
@jskeet jskeet deleted the firestore-custom-serialization branch January 23, 2019 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants