diff --git a/Utilidades.vb b/Utilidades.vb index a575404..ef5f51b 100644 --- a/Utilidades.vb +++ b/Utilidades.vb @@ -836,4 +836,13 @@ Public Class DescripcionValor Return lista End Function + Public Function ObtenerValorDesdeNombre(Of TEnum As Structure)(nombre As String) As Integer? + Dim resultado As TEnum + If [Enum].TryParse(nombre, True, resultado) Then + Return Convert.ToInt32(resultado) + End If + Return Nothing ' Devuelve Nothing si no hay coincidencia + End Function + + End Class diff --git a/tsUtilidades.vbproj b/tsUtilidades.vbproj index 505e2e0..d4b93ba 100644 --- a/tsUtilidades.vbproj +++ b/tsUtilidades.vbproj @@ -16,11 +16,12 @@ net8.0 tsUtilidades net8.0, libreria - 1.0.6 + 1.0.7 Manuel Tecnosis S.A Utilidades varias Entity Framework compatibles con EF Core 8. + - 2025-07-28 1.0.7 Nueva función de ObtenerValorDesdeNombre - 2025-07-22 1.0.6 Nuevas funciones de encriptartexto y desencriptartexto - Se traslada a tecnosis.git no hay cambios respecto a la 1.0.1