예제 #1
0
        public async Task <RentalBase> Create(RentalBase rentalBase)
        {
            _context.RentalBases.Add(rentalBase);
            await _context.SaveChangesAsync();

            return(rentalBase);
        }
예제 #2
0
        public async Task Write_ShouldCreateNewRecord()
        {
            var rentalBase = new RentalBase
            {
                RentalBaseId = 4,
                City         = "City4",
                Street       = "Street4",
                Number       = 4
            };
            var rentalBaseWrite = new RentalBaseDataWrite(_context);
            await rentalBaseWrite.Create(rentalBase);

            Assert.Equal(4, _context.RentalBases.Count());
            Assert.Same(rentalBase, _context.RentalBases.Find(rentalBase.RentalBaseId));
        }