Hi
I want get next sequence next value for identity id using db first code.
For below code: I don't use entity framework.
SaveToDBZypl saveToDBZypl = new SaveToDBZypl();
saveToDBZypl.STATUS = zyplDeserializedClass.result.status;
saveToDBZypl.PROB = Convert.ToInt32(zyplDeserializedClass.result.prob);
saveToDBZypl.MESSAGE = zyplDeserializedClass.result.message;
saveToDBZypl.PREDICTION = zyplDeserializedClass.result.prediction;
saveToDBZypl.SHAP_LINK = zyplDeserializedClass.result.shap_link;
saveToDBZypl.ZYPL_ID = zyplDeserializedClass.result.id;
saveToDBZypl.INSERT_DATE = DateTime.Now;
saveToDBZypl.APPLICATION_ID = sendToZypl.data.Id;
int sequence = _context.Database.SqlQuery<int>("select NBM.EL_GLOBAL_SEQUENCE.nextval from DUAL").First();
saveToDBZypl.ID = sequence;
if (ModelState.IsValid)
{
_context.SaveToDBZypls.Add(saveToDBZypl);
_context.SaveChanges();
}
//My porblem with this part code:
int sequence = context.Database.SqlQuery<int>("select NBM.EL_GLOBAL_SEQUENCE.nextval from DUAL").First();
Need convert it to database first.