예제 #1
0
        public async Task UpdateAsync(GlassDto glassDto)
        {
            var glass = AutoMapper.Mapper.Map <GlassDto, Glass>(glassDto);
            await _glassRepository.UpdateAsync(glass);

            var result = await _glassRepository.GetSingleAsync(glassDto.Id);

            var mappedResult = AutoMapper.Mapper.Map <Glass, GlassDto>(result);
            await _glassElasticsearch.UpdateAsync(mappedResult);
        }
        public async Task UpdateAsync_Get_Updated()
        {
            var glass = _glassRepository.GetAll().LastOrDefault();

            glass.Name = "Update" + DateTime.Now.Ticks;
            await _glassRepository.UpdateAsync(glass);

            var updated = await _glassRepository.GetSingleAsync(glass.GlassId);

            Assert.AreEqual(glass.Name, updated.Name);
        }