protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity(FriendMapping.Map());
            modelBuilder.Entity(GameMapping.Map());
            modelBuilder.Entity(LoanMapping.Map());

            base.OnModelCreating(modelBuilder);
        }
Пример #2
0
        public void SaveFriendRequest(string endUserId, string loggedInUser)
        {
            FriendMapping friendMap = new FriendMapping();

            friendMap.CreatedOn       = DateTime.Now;
            friendMap.EndUserID       = endUserId;
            friendMap.IsActive        = true;
            friendMap.RequestorUserID = loggedInUser;
            friendMap.RequestStatus   = "Sent";
            _roomContext.FriendMappings.Add(friendMap);
        }
Пример #3
0
        public void SendFriendRequest(int endUserID, int loggedInUserID)
        {
            FriendMapping objentity = new FriendMapping();

            objentity.CreatedOn       = System.DateTime.Now;
            objentity.EndUserID       = endUserID;
            objentity.IsActive        = true;
            objentity.RequestorUserID = loggedInUserID;
            objentity.RequestStatus   = "Sent";
            objentity.UpdatedOn       = System.DateTime.Now;
            _context.FriendMappings.Add(objentity);
            _context.SaveChanges();
        }
Пример #4
0
        public IHttpActionResult RemoveFriendMapping(int friendMappingId)
        {
            FriendMapping result = null;

            if (!ModelState.IsValid)
            {
                return(BadRequest("Invalid data."));
            }
            try
            {
                result = _userService.RemoveFriendMapping(friendMappingId);
            }
            catch (HttpResponseException ex)
            {
                throw ex;
            }
            return(Ok(result));
        }