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

Question: Does RepoDB supports C# 9s Records? #708

Open
keithn opened this issue Jan 11, 2021 · 5 comments
Open

Question: Does RepoDB supports C# 9s Records? #708

keithn opened this issue Jan 11, 2021 · 5 comments
Labels
question Further information is requested

Comments

@keithn
Copy link

keithn commented Jan 11, 2021

does repoDB support Records?

also, all the current documentation uses the word "record" to refer to "database" records, which perhaps should be changed to "row"/"rows" as it now conflicts with the first class concept in C# and gives erroneous search results.

@keithn keithn added the question Further information is requested label Jan 11, 2021
@mikependon
Copy link
Owner

Yes, it supports it both C#/F# and also the immutables.

@fubar-coder
Copy link

Just a follow-up question: Can the attributes like PrimaryAttribute applied to a constructor parameter too? Example:

public record Test([Primary] Guid Id, string Name);

@mikependon
Copy link
Owner

Unfortunately, it is not possible. The only thing you can work around with this is to place the Primary attribute into the equivalent property of the ctor argument.

@mikependon
Copy link
Owner

But, since you are using the record type, then it is kind of impossible. We will assess and look at this as part of our enhancements.

@fubar-coder
Copy link

fubar-coder commented Jan 18, 2022

This is my current code:

public record Test(Guid Id, string Name)
{
    [Primary]
    public Guid Id { get; } = Id;
}

This works as expected and is fine as a workaround (at least for me)!

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

No branches or pull requests

3 participants