예제 #1
0
        public async Task <ulong> Post()
        {
            var user = new User();
            await AzureDataBase.UploadUserData(user);

            return(user.ID);
        }
예제 #2
0
        public async Task <string> Put([FromRoute] string birdName, [FromRoute] string coords, [FromRoute] ulong userID)
        {
            try
            {
                var bird = await AzureDataBase.DownloadBirdData(birdName);

                var user = await AzureDataBase.DownloadUserData(userID);

                bird.Coords = coords;
                user.AddBird(bird);
                if (user.BirdsCollection.Count % 5 == 0)
                {
                    user.LVL++;
                }
                await AzureDataBase.UploadUserData(user);

                return("Всё хорошо");
            }
            catch (Exception e) { return(e.Message); }
        }