Ejemplo n.º 1
0
        public ActionResult CreateCrush(long targetId)
        {
            var crushService = new CrushService(RavenSession);

            var crush = crushService.Crush(UserId.ToLongId(), targetId, null);

            return Json(new { success = true });
        }
Ejemplo n.º 2
0
            public ValidCrushes()
            {
                var existingUsers = Builder<User>.CreateListOfSize(10)
                                        .All().With(x => x.Id, null)
                                        .Build().ToList();

                existingUsers.ForEach(x => {
                    Session.Store(x);
                    var friends = new UserFriends()
                    {
                        Id = Session.BuildRavenId<UserFriends>(x.Id.ToLongId()),
                        FriendsIds = existingUsers.Where(y => y.Id != x.Id).ToList().GetRange(0,5).Select(u => u.Id).ToList()
                    };

                    Session.Store(friends);
                });

                Session.SaveChanges();

                service = new CrushService(Session);
            }