Ejemplo n.º 1
0
        public async Task <Advertisement> CreateAdvertisementAsync(Advertisement advertisement)
        {
            if (advertisement == null)
            {
                throw new ArgumentNullException(nameof(advertisement));
            }

            _dbContext.Advertisements.Add(advertisement);
            await _dbContext.SaveChangesAsync();

            return(advertisement);
        }
Ejemplo n.º 2
0
        public async Task <Phone> CreatePhoneAsync(Phone phone)
        {
            if (phone == null)
            {
                throw new ArgumentNullException(nameof(phone));
            }

            _dbContext.Phones.Add(phone);
            await _dbContext.SaveChangesAsync();

            return(phone);
        }