Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Get nextvalue of sequence in EntityFramework

$
0
0

I am trying to get the nextvalue of a sequence for my blazorserver.

The sequence was created long ago in the existing database.

And I want to retrive the value throught my newly developed blazorserver.

Model Builder

modelBuilder.HasSequence<long>("sequence_name");

Code

var seq = _db.Database.ExecuteSqlRaw("select nextval('sequence_name')");

Result

seq = -1

What is the correct way to get the next value of the sequence?


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>