public void Add(Status status, IEnumerable<User> users) { foreach (var user in users) { var wallItem = new WallItem { Unread = true, Status = status, User = user, }; db.WallItemSet.AddObject(wallItem); } db.SaveChanges(); }
/// <summary> /// Deprecated Method for adding a new object to the WallItemSet EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToWallItemSet(WallItem wallItem) { base.AddObject("WallItemSet", wallItem); }
/// <summary> /// Create a new WallItem object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="unread">Initial value of the Unread property.</param> public static WallItem CreateWallItem(global::System.Int32 id, global::System.Boolean unread) { WallItem wallItem = new WallItem(); wallItem.Id = id; wallItem.Unread = unread; return wallItem; }