Skip to content

How to Associate Sequences with Tables? #33

@l2999019

Description

@l2999019

I used codefrist to generate tables and primary keys, and automatically generated new sequences for each primary key.
Like this:
image
But I added the code as follows:
using (BloggingContext db = new BloggingContext()) { db.Blogs.Add(new Blog { Url = "aaaaa1" }); db.SaveChanges(); }
I will get an error message:
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

Because I didn't copy the primary key。
I found the sequence of ForOracleUseSequenceHiLo method settings
like this
entity.Property(o => o.Id).ForOracleUseSequenceHiLo("aa_sq");

But I can't determine the automatically generated sequence name. Or do you have a better way to connect directly?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions