How to get identifiers from ormlite call SaveAll ()

I use ORMLite to save several objects similar to:

var graphs = Builder<UserGraph>.CreateListOfSize(10)
            .And(x => x.UserId = User.Id)
            .Build();

Db.SaveAll(graphs);

Is there a way to automatically set the id property for each object. If not, is there a way to get identifiers for all inserted objects?

+5
source share
1 answer

You can add an AutoIncrement attribute to the Id property:

[AutoIncrement]
public int UserId{ get; set; }
0
source

All Articles