public async Task <List <Event> > GetAll()
        {
            var(start, count) = ParseGetAllHeaders(Request.Headers);

            User currentUser = await UserRetrievingService.GetByUserName(User.Identity.Name);

            int cityId = currentUser.Location.City.Id;

            return(await EventRetrievingService.GetBatchSortedByLocation(cityId, start, count));
        }
        public async Task <ProfileModel> Edit([FromBody] ProfileModel editModel)
        {
            ProfileUser user = await UserRetrievingService.GetByUserName(User.Identity.Name);

            if (editModel.Id != user.Id)
            {
                throw new InvalidOperationException("You cannot edit current profile");
            }

            ProfileUser editedUser = Mapper.Map(editModel, user);

            await UserManager.UpdateAsync(editedUser);

            return(editModel);
        }
        public async Task UnsubscribeFromEvent([FromUri] Guid eventId)
        {
            User currentUser = await UserRetrievingService.GetByUserName(User.Identity.Name);

            await SubscribeOnEventService.Unsubscribe(currentUser.Id, eventId);
        }