Esempio n. 1
0
        public static Response Execute(string request)
        {
            var req = JsonConvert.DeserializeObject <Request <GetGameGroupListFilter> >(request);

            var cmd = CommandHelper.CreateProcedure <GameGroup>(FetchType.Fetch, "sp_GetGameGroupList");

            cmd.Params.Add(CommandHelper.CreateParam("@gameId", req.Filter.GameId));
            cmd.Params.Add(CommandHelper.CreateParam("@groupId", req.Filter.GroupId));
            var result = DbContext.GetInstance().Execute(cmd);

            if (req.Filter.IsContainMember)
            {
                foreach (var group in result.Entities)
                {
                    GameHelper.SetGroupMemberList(group as GameGroup);
                }
            }

            return(result);
        }