public async Task <ExchangeOrder> Update(ExchangeOrder contract)
        {
            var entity = ContractToEntity(contract);

            entity = await _eoRepo.Update(entity);

            return(EntityToContract(entity));
        }
示例#2
0
        public void UpdateOne_Test()
        {
            var id          = 1;
            var newProperty = DateTime.UtcNow;
            var entity      = _repo.GetOne(id).Result;

            Assert.NotNull(entity);
            Assert.Equal(id, entity.Id);

            entity.ClosedDate = newProperty;

            var updatedEntity = _repo.Update(entity).Result;

            Assert.Equal(entity.ClosedDate, updatedEntity.ClosedDate);

            var entityFetch = _repo.GetOne(id).Result;

            Assert.NotNull(entityFetch);
            Assert.Equal(id, entityFetch.Id);
            Assert.Equal(newProperty, entityFetch.ClosedDate);
        }