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()); }
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 })); }