Exemplo n.º 1
0
        public void GetDataJenisHakByIdTest()
        {
            GetDataJenisHakByIdRequest request = new GetDataJenisHakByIdRequest();

            request.idHak = _jenisHakGetDataById.IDHak;

            GetDataJenisHakByIdResponse response = _jenisHakService.GetDataJenisHakById(request);

            Assert.IsTrue(response.Messages.Count == 0, "Failed get data by Id");
        }
Exemplo n.º 2
0
        public GetDataJenisHakByIdResponse GetDataJenisHakById(GetDataJenisHakByIdRequest request)
        {
            GetDataJenisHakByIdResponse response = new GetDataJenisHakByIdResponse();

            try
            {
                using (TransactionScope transScope = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions {
                    IsolationLevel = IsolationLevel.ReadCommitted
                }))
                {
                    response.JenisHak = _jenisHakRepo.GetDataById(request.idHak);
                    transScope.Complete();
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.ToString());
            }

            return(response);
        }