Beispiel #1
0
        public async Task <int> UpdateAsync(PhoneCreateInputModel input)
        {
            var phone = this.phonesRepository.All().FirstOrDefault(x => x.Id == input.Id);

            phone.Phone     = input.Phone;
            phone.PhoneType = input.PhoneType;
            this.phonesRepository.Update(phone);

            return(await this.phonesRepository.SaveChangesAsync());
        }
Beispiel #2
0
        public async Task <IActionResult> Add(PhoneCreateInputModel input)
        {
            await this.phonesServices.CreateAsync(input.Phone, input.PhoneType, input.CustomerId);

            return(this.RedirectToAction("Details", "Customers", new { id = input.CustomerId }));
        }