Пример #1
0
        public async Task UpdatePlace(PlaceLite place)
        {
            Place addedPlace = new Place(place, await GetUserById(place.addedBy.userId));
            await router.UpdatePlace(addedPlace);

            place.id = addedPlace.id;
        }
Пример #2
0
        private async Task UpdatePlace()
        {
            string receive;

            receive = reader.ReadLine();
            PlaceLite place = JsonSerializer.Deserialize <PlaceLite>(receive);

            await model.UpdatePlace(place);
        }
Пример #3
0
        private async Task AddPlace()
        {
            string receive;

            receive = reader.ReadLine();
            Console.WriteLine(receive);
            PlaceLite place = JsonSerializer.Deserialize <PlaceLite>(receive);
            await model.AddPlace(place);

            string placeJson = JsonSerializer.Serialize(place);

            writer.WriteLine(placeJson);
        }
Пример #4
0
        private async Task InitPlace()
        {
            User user = new User()
            {
                savedPlaces = new List <Place>(),
                auth        = 1,
                password    = "******",
                username    = "******",
                email       = "*****@*****.**"
            };
            await router.CreateUser(user);

            PlaceLite reitan = new PlaceLite()
            {
                title       = "Reitan",
                description = "Heaven",
                longitude   = 9.795995847440167,
                latitude    = 55.83663617092108,
                reviews     = new List <ReviewLite>(),
                addedBy     = new UserData(user)
            };

            await AddPlace(reitan);

            Report <PlaceLite> report = new Report <PlaceLite>()
            {
                category     = "Blyatity",
                reportedItem = reitan
            };

            await AddPlaceReport(report);

            ReviewLite review = new ReviewLite()
            {
                rating  = 1,
                comment = "very beautiful, but my back hurts",
                addedBy = new UserData(user)
            };
            ReviewLite newReview = new ReviewLite()
            {
                rating  = 1,
                comment = "rema 1000 tak",
                addedBy = new UserData(user)
            };

            await AddPlaceReview(reitan.id, review);
            await AddPlaceReview(reitan.id, newReview);
        }