コード例 #1
0
        public async Task <string> AddParkingLotAsync(ParkingLotDto parkingLotDto)
        {
            var parkingLotEntity = new ParkingLotEntity()
            {
                Name     = parkingLotDto.Name,
                Capacity = parkingLotDto.Capacity.HasValue ? parkingLotDto.Capacity.Value : 0,
                Location = parkingLotDto.Location,
            };
            await parkingLotDbContext.AddAsync(parkingLotEntity);

            await parkingLotDbContext.SaveChangesAsync();

            return(parkingLotEntity.Name);
        }
コード例 #2
0
        public async Task <Data.Vehicle> Create(Data.Vehicle entity)
        {
            await _context.AddAsync(entity);

            return(entity);
        }
コード例 #3
0
        public async Task <Data.Establishment> Create(Data.Establishment entity)
        {
            await _context.AddAsync(entity);

            return(entity);
        }