public List<CAT_OPERACION_ESTRUCTURA_V2_Model> OperacionEstructura_Select(string KeySesion) { List<CAT_OPERACION_ESTRUCTURA_V2_Model> lst = new List<CAT_OPERACION_ESTRUCTURA_V2_Model>(); ObservableCollection<WAPP_USUARIO_SESION> Key = new ObservableCollection<WAPP_USUARIO_SESION>(); try { using (var entity_ = new db_SeguimientoProtocolo_r2Entities()) { (from s in entity_.WAPP_USUARIO_SESION where s.IdSesion == KeySesion select s).ToList().ForEach(row => { Key.Add(new WAPP_USUARIO_SESION() { IdUsuario = row.IdUsuario, IdSesion = row.IdSesion }); }); if (Key[0].IdSesion == KeySesion.ToString()) { using (var entity = new db_SeguimientoProtocolo_r2Entities()) { entity.SP_OperacionEstructuraSelect().ToList().ForEach(row => { lst.Add(new CAT_OPERACION_ESTRUCTURA_V2_Model() { IdOperacionEstructura = row.IdOperacionEstructura.ToString(), IdCondicion = row.IdCondicion, CondicionName = row.CondicionName, IdEstructura = row.IdEstructura, PuntoMedicionName = row.PuntoMedicionName, OperacionEstrucuturaName = row.OperacionEstrucuturaName, IsActive = row.IsActive, IsModified = row.IsModified, LastModifiedDate = row.LastModifiedDate, ServerLastModifiedDate = long.Parse(row.ServerLastModifiedDate.ToString()) }); }); } } } } catch (Exception ex) { var errr = ex.Message; } return lst; }