public PhoneNumberViewModel MapSinglePhoneNumber(PHB_PhoneNumber d) { Id = d.Id; PhoneBookId = d.PhoneBookId; Name = d.Name; Email = d.Email; Number = d.Number; return(this); }
private async Task AddPhoneNumber() { if (!await _context.PHB_PhoneNumber.AnyAsync()) { PHB_PhoneNumber num = new PHB_PhoneNumber() { PhoneBookId = 1, Name = "Robert One", Email = "*****@*****.**", Number = "0727601650", }; PHB_PhoneNumber num1 = new PHB_PhoneNumber() { PhoneBookId = 1, Name = "Robert Two", Email = "*****@*****.**", Number = "0727601651", }; PHB_PhoneNumber num2 = new PHB_PhoneNumber() { PhoneBookId = 1, Name = "Robert Three", Email = "*****@*****.**", Number = "0727601652", }; await _context.PHB_PhoneNumber.AddAsync(num); await _context.PHB_PhoneNumber.AddAsync(num1); await _context.PHB_PhoneNumber.AddAsync(num2); await _context.SaveChangesAsync(); } }
public PhoneNumberViewModel(PHB_PhoneNumber d) { MapSinglePhoneNumber(d); }