public bool BatchInsert(object[] items) { var _db = new dbEcustomEntities(Common.Decrypt(ConfigurationManager.ConnectionStrings["dbEcustomEntities"].ConnectionString, true)); try { _db.Connection.Open(); foreach (object item in items) { _db.AddObjectDirectly("tblProfileConfigs", item); } _db.SaveChanges(); return true; } catch (Exception ex) { LogManager.GetLogger("ECustoms.AllFactory").Error(ex.ToString()); throw; } finally { _db.Connection.Close(); } return false; }