public static void CreateCategoria(PI_BA_Categoria cat) { using (var dbContext = new wPremiosInstitucionalesdbEntities()) { try { dbContext.AddCategoria(cat.cveCategoria, cat.Nombre, cat.cveConvocatoria, cat.cveAplicacionGanadora, cat.FechaCreacion, cat.UsuarioCreacion, cat.FechaEdicion, cat.UsuarioEdicion); dbContext.SaveChanges(); } catch (Exception Ex) { Console.WriteLine("Catched Exception: " + Ex.Message + Environment.NewLine); } } }