public async Task AddApartmentAsync(ApartmentDto apartment) { var entry = apartment.ToEntry(); await _baseInfoContext.ApartmentInfos.AddAsync(entry); await _baseInfoContext.SaveChangesAsync(); apartment.ApartmentId = entry.ApartmentId; }
public void Apartment_Map_To_Entry() { ApartmentDto otdto = new ApartmentDto { BuildingId = 1, Area = 29, ApartmentId = 4, Number = 34 }; ApartmentInfo ow = otdto.ToEntry(); bool check = false; if (otdto.Number == ow.Number && otdto.BuildingId == ow.BuildingId && otdto.ApartmentId == ow.ApartmentId && ow.Area == otdto.Area) { check = true; } Assert.IsTrue(check); }