public tb_Sexo ObtenerSexo(int idSexo) { var sexo = new tb_Sexo(); try { using (var ctx = new SeguroContext()) { sexo = ctx.tb_Sexo .Where(x => x.IdSexo == idSexo) .SingleOrDefault(); } } catch (Exception e) { ELog.save(this, e); //throw; } return(sexo); }
public int ObtenerSexo(string descripcionSexo) { var sexo = new tb_Sexo(); try { using (var ctx = new SeguroContext()) { sexo = ctx.tb_Sexo .Where(x => x.DescripcionSexo.StartsWith(descripcionSexo)) .SingleOrDefault(); } } catch (Exception e) { ELog.save(this, e); //throw; } return(sexo.IdSexo); }