コード例 #1
0
        public override IEnumerable<Spawn2> GetLinkedSpawn2()
        {
            List<Spawn2> spawns = new List<Spawn2>();

            var query = _getSpawn2;
            if (query != null)
            {
                string sql = String.Format(query.SelectQuery, new string[] { Id.ToString() });
                var results = Database.QueryHelper.RunQuery(_connection, sql);
                foreach (var row in results)
                {
                    var spawn = new Spawn2(_queryConfig);
                    spawn.SetProperties(query, row);
                    spawns.Add(spawn);
                }
            }
            return spawns;
        }
コード例 #2
0
        public void Lookup(string zone, int version)
        {
            _zone = zone;
            _version = version;

            UnlockObject();

            string sql = "";

            if (_version == -1)
            {
                sql = String.Format(_allVersions.SelectQuery, ResolveArgs(_allVersions.SelectArgs));
            }
            else
            {
                sql = String.Format(SelectString, SelectArgValues);
            }

            var results = Database.QueryHelper.RunQuery(_connection, sql);
            if (results != null)
            {
                foreach (var row in results)
                {
                    Spawn2 s = new Spawn2(_queryConfig);
                    s.SetProperties(Queries, row);
                    s.Created();
                    Spawns.Add(s);
                }
            }

            Created();
        }