public int addGibUserList(GibUserListXmlModel userList) { using (DatabaseContext databaseContext = new DatabaseContext()) { GibUsers gibUser; foreach (var user in userList.Items) { gibUser = new GibUsers(); gibUser.aliasPk = user.alias; gibUser.identifier = user.identifier; gibUser.title = user.title; gibUser.productType = user.documentTpye; // databaseContext.gibUsers.Add(gibUser); if (user.identifier == "4840847211") { databaseContext.gibUsers.Add(gibUser); } } return(databaseContext.SaveChanges()); } }
public void addGibUser(string aliasPk, string identifier, string title) { using (DatabaseContext databaseContext = new DatabaseContext()) { GibUsers gibUsers = new GibUsers(); gibUsers.aliasPk = aliasPk; gibUsers.identifier = identifier; gibUsers.title = title; databaseContext.gibUsers.Add(gibUsers); databaseContext.SaveChanges(); } }