Exemple #1
0
        public async Task AddAdultAsync([FromBody] Adult adult, [FromQuery] string streetName,
                                        [FromQuery] int?houseNumber)
        {
            try
            {
                Console.WriteLine(adult.FirstName + " " + streetName + " " + houseNumber);

                Family familyToAdd = familyService.GetFamiliesAsync().Result.First(familyTo =>
                                                                                   familyTo.StreetName.Equals(streetName) && familyTo.HouseNumber == houseNumber);
                await familyService.AddAdultAsync(adult, familyToAdd);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                throw;
            }
        }