Ejemplo n.º 1
0
        public BusinessObject Find(string id)
        {
            var query = Connection.Query($"SELECT * FROM BusinessObject WHERE id = \"{id}\";");

            query.Read();
            var obj = new BusinessObject()
            {
                Id   = query["id"].ToString(),
                Name = query["name"].ToString(),
                Data = query["data"].ToString()
            };

            query = Connection.Query($"SELECT * FROM Tag WHERE business_object = \"{id}\";");
            while (query.Read())
            {
                obj.AddTag(new Tag
                {
                    Text = query["content"].ToString()
                });
            }
            return(obj);
        }