コード例 #1
0
ファイル: BOSEntityService.cs プロジェクト: CobyC/JaRS
        /// <summary>
        /// Returns a single BOSRecord 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 FetchLazy was set to false, the JarsBOSRecord item will be populated, if not then the JarsBOSRecordBase record will be filled with data.</returns>
        public virtual BOSEntityResponse Any(GetBOSEntity request)
        {
            BOSEntityResponse response = new BOSEntityResponse();
            IGenericEntityRepositoryBase <BOSEntity, IDataContextBOS> _repository = _DataRepositoryFactory.GetDataRepository <IGenericEntityRepositoryBase <BOSEntity, IDataContextBOS> >();

            response.BOSEntity = _repository.GetById(request.Id, true).ConvertTo <BOSEntityDto>();
            return(response);
        }
コード例 #2
0
ファイル: BOSEntityService.cs プロジェクト: CobyC/JaRS
        public virtual BOSEntityResponse Any(StoreBOSEntity request)
        {
            BOSEntityResponse response = new BOSEntityResponse();
            IGenericEntityRepositoryBase <BOSEntity, IDataContextBOS> _repository = _DataRepositoryFactory.GetDataRepository <IGenericEntityRepositoryBase <BOSEntity, IDataContextBOS> >();

            if (request.BOSEntity != null)
            {
                response.BOSEntity = _repository.CreateUpdate(request.BOSEntity.ConvertTo <BOSEntity>(), CurrentSessionUsername).ConvertTo <BOSEntityDto>();
            }
            return(response);
        }