public static PI_BA_Premio GetPremioById(String idPremio) { using (var dbContext = new wPremiosInstitucionalesdbEntities()) { try { return(dbContext.GetPremio(idPremio).FirstOrDefault()); } catch (Exception Ex) { Console.WriteLine("Catched Exception: " + Ex.Message + Environment.NewLine); return(null); } } }
public static List <PI_BA_Premio> GetAllPremios() { using (var dbContext = new wPremiosInstitucionalesdbEntities()) { try { return(dbContext.GetPremio(null).ToList()); } catch (Exception Ex) { Console.WriteLine("Catched Exception: " + Ex.Message + Environment.NewLine); return(null); } } }