コード例 #1
0
        public void GetDataByIDKecamatanTest()
        {
            GetDataKecamatanByIdRequest request = new GetDataKecamatanByIdRequest();

            request.idKecamatan = _kecamatanGetDataById.IDKecamatan;

            GetDataKecamatanByIdResponse response = _kecamatanService.GetDataKecamatanById(request);

            Assert.IsTrue(response.Messages.Count == 0, "Failed get data by Id");
        }
コード例 #2
0
ファイル: KecamatanService.cs プロジェクト: amjadmujaddid/AIS
        public GetDataKecamatanByIdResponse GetDataKecamatanById(GetDataKecamatanByIdRequest request)
        {
            GetDataKecamatanByIdResponse response = new GetDataKecamatanByIdResponse();

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

            return(response);
        }