public static bool Create(T_Tag tag) { using (ConcertFinderEntities bdd = new ConcertFinderEntities()) { try { bdd.AddToT_Tag(tag); bdd.SaveChanges(); } catch (Exception) { return false; } } return true; }
static public bool Update(T_Tag tag) { using (ConcertFinderEntities bdd = new ConcertFinderEntities()) { try { var n_tag = new T_Tag { Id = tag.Id }; bdd.T_Tag.Attach(n_tag); bdd.ApplyCurrentValues("T_Tag", tag); bdd.SaveChanges(); } catch (Exception) { return false; } } return true; }
/// <summary> /// Deprecated Method for adding a new object to the T_Tag EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToT_Tag(T_Tag t_Tag) { base.AddObject("T_Tag", t_Tag); }
/// <summary> /// Create a new T_Tag object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="name">Initial value of the Name property.</param> public static T_Tag CreateT_Tag(global::System.Int64 id, global::System.String name) { T_Tag t_Tag = new T_Tag(); t_Tag.Id = id; t_Tag.Name = name; return t_Tag; }