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

Add support for many types per table relationships #21

Open
simon-reynolds opened this issue Jan 25, 2019 · 0 comments
Open

Add support for many types per table relationships #21

simon-reynolds opened this issue Jan 25, 2019 · 0 comments

Comments

@simon-reynolds
Copy link
Collaborator

These models were related types are all stored in one database table using a discrimator column would traditionally be modelled in C# using inheritance

They should be modelled as Discrimated Unions in F#

Example:

C#

public abstract class Person {}

public class Employee : Person {}

public class Manager : Person {}

F#

type Person =
| Employee of Employee
| Manager of Manager
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant