public void InsertDataKecamatanTest() { InsertDataKecamatanaRequest request = new InsertDataKecamatanaRequest(); request.Kecamatan = _kecamatanValid; InsertDataKecamatanResponse response = _kecamatanService.InsertDataKecamatan(request); Assert.IsTrue(response.Messages.Count == 0, "Failed insert data"); }
public InsertDataKecamatanResponse InsertDataKecamatan(InsertDataKecamatanaRequest request) { InsertDataKecamatanResponse response = new InsertDataKecamatanResponse(); try { using (TransactionScope transScope = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions { IsolationLevel = IsolationLevel.ReadCommitted })) { _kecamatanRepo.Add(request.Kecamatan); transScope.Complete(); } } catch (Exception ex) { throw new Exception(ex.ToString()); } return(response); }