Exemplo n.º 1
0
        public void InsertDataWarkahTest()
        {
            InsertDataWarkahRequest request = new InsertDataWarkahRequest();

            request.Warkah = _warkahValidData;

            InsertDataWarkahResponse response = _warkahService.InsertDataWarkah(request);

            Assert.IsTrue(response.Messages.Count == 0, "Failed insert data");
        }
Exemplo n.º 2
0
        public InsertDataWarkahResponse InsertDataWarkah(InsertDataWarkahRequest request)
        {
            InsertDataWarkahResponse response = new InsertDataWarkahResponse();

            try
            {
                using (TransactionScope transScope = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions {
                    IsolationLevel = IsolationLevel.ReadCommitted
                }))
                {
                    _warkahRepo.Add(request.Warkah);
                    transScope.Complete();
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.ToString());
            }

            return(response);
        }