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

Value Converters for ID/Key Types #6

Open
ardalis opened this issue Mar 9, 2018 · 1 comment
Open

Value Converters for ID/Key Types #6

ardalis opened this issue Mar 9, 2018 · 1 comment

Comments

@ardalis
Copy link

ardalis commented Mar 9, 2018

I'm still struggling to get something like this working with the 2.1 bits:

        public struct BlogId
        {
            public BlogId(int id)
            {
                Id = id;
            }
            public int Id { get; set; }
        }

        public class Blog
        {
            public BlogId BlogId { get; set; }
            public string BlogUrl { get; set; }
            public Theme Theme { get; set; }
        }

What I'd like is for dotnet ef database update to produce the same structure as if I simply had public int BlogId {get; set; } on Blog. Can you add an example showing how to set up this kind of thing? Thanks!

@ardalis
Copy link
Author

ardalis commented May 20, 2018

Is this possible now in 2.1RC1?

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

No branches or pull requests

1 participant