Beispiel #1
0
        public async Task <Tuple <RestaurantObjects, EmployersRestaurants> > AddNewRestaurantAsync(long ownerId, string restaurantName, string restaurantDescription)
        {
            CheckTheLoggedInPerson();

            Employers currentEmployer = await CheckEmployerExistenceAsync(ownerId);

            RestaurantObjects restaurantItem = new RestaurantObjects
            {
                Name        = restaurantName,
                Description = restaurantDescription
            };

            await RestaurantRepo.AddAsync(restaurantItem, ModifierId);

            EmployersRestaurants item = new EmployersRestaurants
            {
                EmployerId   = currentEmployer.Id,
                RestaurantId = restaurantItem.Id
            };

            await EmployerRestaurantRepo.AddAsync(item, ModifierId);

            return(new Tuple <RestaurantObjects, EmployersRestaurants>(restaurantItem, item));
        }