示例#1
0
        public async Task AddBuildingAsync(BuildingDto building)
        {
            var entry = building.ToEntry();
            await _baseInfoContext.BuildingInfos.AddAsync(entry);

            await _baseInfoContext.SaveChangesAsync();

            building.BuildingId = entry.BuildingId;
        }
示例#2
0
        public void BuildingDto_Map_To_Entry()
        {
            BuildingDto otdto = new BuildingDto
            {
                BuildingId    = 1,
                Name          = "gholam",
                NumberOfUnits = 4
            };
            BuildingInfo ow = otdto.ToEntry();

            bool check = false;

            if (ow.BuildingId == otdto.BuildingId && ow.ApartmentCount == otdto.NumberOfUnits &&
                otdto.Name == ow.BuildingName)
            {
                check = true;
            }
            Assert.IsTrue(check);
        }