public void GetDataDesaByIdTest() { GetDataDesaByIdRequest request = new GetDataDesaByIdRequest(); request.idDesa = _desaGetDataById.IDDesa; GetDataDesaByIdResponse response = _desaService.GetDataDesaById(request); Assert.IsTrue(response.Messages.Count == 0, "Failed get data by Id"); }
public GetDataDesaByIdResponse GetDataDesaById(GetDataDesaByIdRequest request) { GetDataDesaByIdResponse response = new GetDataDesaByIdResponse(); try { using (TransactionScope transScope = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions { IsolationLevel = IsolationLevel.ReadCommitted })) { response.Desa = _desaRepo.GetDataById(request.idDesa); transScope.Complete(); } } catch (Exception ex) { throw new Exception(ex.ToString()); } return(response); }