Exemple #1
0
        public void UpdateDataDesaTest()
        {
            UpdateDataDesaRequest request = new UpdateDataDesaRequest();

            request.Desa = _desaUpdateData;
            UpdateDataDesaResponse response = _desaService.UpdateDataDesa(request);

            Assert.IsTrue(response.Messages.Count == 0, "Failed update data");
        }
Exemple #2
0
        public UpdateDataDesaResponse UpdateDataDesa(UpdateDataDesaRequest request)
        {
            UpdateDataDesaResponse response = new UpdateDataDesaResponse();

            try
            {
                using (TransactionScope transScope = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions {
                    IsolationLevel = IsolationLevel.ReadCommitted
                }))
                {
                    _desaRepo.Update(request.Desa);
                    transScope.Complete();
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.ToString());
            }
            return(response);
        }