public void registrarHobby(int codigo, string descripcion) { try { hobby hb = new hobby(); hb.codigo = codigo; hb.descripcion = descripcion; HobbyDAO hDAO = new HobbyDAO(); hDAO.registrarHobby(hb); } catch (Exception e) { //throw new FaultException("El codigo ya se encuentra registrado. Ingreso uno distinto"); throw new FaultException(e.Message); } }
/// <summary> /// Deprecated Method for adding a new object to the hobbies EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddTohobbies(hobby hobby) { base.AddObject("hobbies", hobby); }
/// <summary> /// Create a new hobby object. /// </summary> /// <param name="codigo">Initial value of the codigo property.</param> public static hobby Createhobby(global::System.Int32 codigo) { hobby hobby = new hobby(); hobby.codigo = codigo; return hobby; }