public void InsertDataJenisHakTest() { InsertDataJenisHakRequest request = new InsertDataJenisHakRequest(); request.JenisHak = _jenisHakValidData; InsertDataJenisHakResponse response = _jenisHakService.InsertDataJenisHak(request); Assert.IsTrue(response.Messages.Count == 0, "Failed insert data"); }
public InsertDataJenisHakResponse InsertDataJenisHak(InsertDataJenisHakRequest request) { InsertDataJenisHakResponse response = new InsertDataJenisHakResponse(); try { using (TransactionScope transScope = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions { IsolationLevel = IsolationLevel.ReadCommitted })) { _jenisHakRepo.Add(request.JenisHak); transScope.Complete(); } } catch (Exception ex) { throw new Exception(ex.ToString()); } return(response); }