Beispiel #1
0
        /// <summary>
        /// 获取列表数据
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public async Task <ApiResultList <XsCompyBaseDO> > GetAllSync(XsCompyBaseDTO model)
        {
            var expression = model.GetExpression();
            var orders     = model.GetOrder();
            var entities   = await _pbBasicFirmRepository.GetAllAsync(expression, isMaster : false, orderByFields : orders);

            return(ApiResultUtil.IsSuccess <XsCompyBaseDO>(entities?.ToList()));
        }
Beispiel #2
0
        /// <summary>
        /// 初始化状态数据
        /// </summary>
        /// <returns></returns>
        protected override async Task <XsCompyBaseState> OnReadFromDbAsync()
        {
            string firm = this.GrainId;
            Expression <Func <XsCompyBaseDO, bool> > expression = oo => oo.XOB_Firm == firm;
            var dbResult = await _xsCompyBaseRepository.GetAllAsync(expression, isMaster : false);

            var state = new XsCompyBaseState
            {
                Balance        = dbResult.ToList(),
                ExpiresAt      = System.DateTime.UtcNow.AddHours(2),
                GrainDataState = GrainDataState.Loaded
            };

            return(state);
        }