public List<UsuarioModel> get_User(string KeySesion) { List<UsuarioModel> appUser = new List<UsuarioModel>(); 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_AppUsuarioSelect().ToList().ForEach(row => { appUser.Add(new UsuarioModel() { IdUsuario= row.IdUsuario, UsuarioCorreo = row.UsuarioCorreo, Nombre = row.Nombre, Apellido = row.Apellido, Area = row.Area, Puesto = row.Puesto, IsActive = row.IsActive, IsModified = row.IsModified, LastModifiedDate = row.LastModifiedDate, IsNewUser = row.IsNewUser, IsVerified = row.IsVerified, IsMailSent = row.IsMailSent, ServerLastModifiedDate = long.Parse(row.ServerLastModifiedDate.ToString()), UsuarioPwd = row.UsuarioPwd, RolName= row.RolName, IdRol= row.IdRol.ToString() }); }); } } } } catch (Exception ex) { var errr = ex.Message; } return appUser; }