how to get the id of the object that I just saved with EntityState.Added (C # Linq)

0

I have a function that receives generic objects to save new data with EntityState.Added but I want to add that I return the object with its assigned id

public void addDataObject(object obj)
{
        _dbContext.Entry((TEntity)obj).State = System.Data.Entity.EntityState.Added;
        _dbContext.SaveChanges();
}
    
asked by Luis Alberto Acosta 10.07.2018 в 18:57
source

0 answers