My english isn't perfect but I'll try:
I'm making an application to import data from another knowed database. And my actual problem is to save that primary key I've set, something like this:
foreach (TB_FILIAIS filial in dadosMulti.TB_FILIAIS.ToList())
{
EMPRESA objEmpresa = new EMPRESA();
objEmpresa.ID = filial.CODLOJA;
dadosVistaERP.AddObject(typeof(EMPRESA).Name, objEmpresa);
}
dadosVistaERP.SaveChanges();
I really need to save that objEmpresa.ID I've set.
DadosMulti and dadosVistaERP are my ObjectContext that I'm using to do the import.
The table EMPRESA is Identity(1,1) on column ID
Can anyone help me?