コード例 #1
0
        private Core.Player.Data.PlayerActivityLog GetPlayerActivityLog(Guid playerId, string category, string activityDone)
        {
            Func <Core.Player.Data.PlayerActivityLog> func = () =>
            {
                var playerActivityLogs = _playerQueries.GetPlayerActivityLog().FirstOrDefault(
                    x => x.Category == category && x.PlayerId == playerId &&
                    x.ActivityDone == activityDone
                    );
                return(playerActivityLogs);
            };

            return(WaitFor(func, TimeSpan.FromSeconds(30)));
        }
コード例 #2
0
        public IHttpActionResult ActivityLog([FromUri] SearchPackage searchPackage)
        {
            var query = _playerQueries.GetPlayerActivityLog();

            var dataBuilder = new SearchPackageDataBuilder <PlayerActivityLog>(searchPackage, query);

            dataBuilder.Map(obj => obj.Id, od => new object[]
            {
                od.Category,
                od.ActivityDone,
                od.PerformedBy,
                od.DatePerformed.ToString("yyyy/MM/dd HH:mm:ss zzz"),
                od.Remarks,
                od.UpdatedBy,
                od.DateUpdated.HasValue ? od.DateUpdated.Value.ToString("yyyy/MM/dd HH:mm:ss zzz") : null
            });

            return(Ok(dataBuilder.GetPageData(obj => obj.DatePerformed)));
        }