예제 #1
0
        /// <summary>
        /// Returns a single job where the id in the request matches the record ID in the database.
        /// </summary>
        /// <param name="request">The request used for requesting the record from the database.</param>
        /// <returns>If FetchAsDto was set to false, the JarsJob item will be populated, if not then the JobDto record will have it's values set.</returns>
        public virtual JarsJobsResponse Any(GetJarsJob request)
        {
            //return ExecuteFaultHandledMethod(() =>
            //{
            JarsJobsResponse   response    = new JarsJobsResponse();
            IJarsJobRepository _repository = _DataRepositoryFactory.GetDataRepository <IJarsJobRepository>();

            response.Jobs.Add(_repository.GetById(request.Id, request.FetchEagerly).ConvertTo <JarsJobDto>());
            return(response);
            //});
        }
예제 #2
0
        void use_repository_factory_to_get_non_generic_repositories_and_create_record()
        {
            IJarsJobRepository jarsRep = _repFactory.GetDataRepository <IJarsJobRepository>();


            Assert.IsNotNull(jarsRep);
            //Assert.IsNotNull(qlRep);

            //test create
            JarsJob jj = jarsRep.CreateUpdate(new JarsJob(), "NONGEN_FACT_TEST");

            Assert.IsTrue(jj.Id > 0);


            //test read
            jj = jarsRep.GetById((long)1);
            Assert.IsTrue(jj.Id == 0);
        }