//Add a friendship public ActionResult Add(Guid UserId) { Friendship f = new Friendship(); f.UserId = (Guid)currentUser.ProviderUserKey; f.FriendId = UserId; f.FriendshipId = System.Guid.NewGuid(); friendshipRepo.Add(f); friendshipRepo.Save(); return RedirectToAction("Index"); }
/// <summary> /// Deprecated Method for adding a new object to the Friendships EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToFriendships(Friendship friendship) { base.AddObject("Friendships", friendship); }
public void Add(Friendship f) { entities.Friendships.AddObject(f); }
/// <summary> /// Create a new Friendship object. /// </summary> /// <param name="friendshipId">Initial value of the FriendshipId property.</param> /// <param name="userId">Initial value of the UserId property.</param> /// <param name="friendId">Initial value of the FriendId property.</param> public static Friendship CreateFriendship(global::System.Guid friendshipId, global::System.Guid userId, global::System.Guid friendId) { Friendship friendship = new Friendship(); friendship.FriendshipId = friendshipId; friendship.UserId = userId; friendship.FriendId = friendId; return friendship; }