private void ObterTypesMetaInfo(string url, string namespaceOwner) { var type = string.Empty; var document = LoadDocument(url); var nodes = document.DocumentNode.SelectNodes("//table[starts-with(@id,\"typeList\")]//tr"); if (nodes != null) foreach (var tr in nodes) { if (tr.ChildNodes.Count > 0 && tr.ChildNodes[1].Name == "th") { type = tr.ChildNodes[3].InnerText; } var col = tr.SelectNodes("td"); if (col != null) { var typeName = col[1].SelectSingleNode("a").InnerText; var typeLink = col[1].SelectSingleNode("a").GetAttributeValue("href", string.Empty); var typeMetaInfo = new TypeMetaInfo(typeName, namespaceOwner) { Link = typeLink, Descricao = col[2].InnerText, Type = type }; this.armazenador.ArmazenarType(typeMetaInfo); this._enfileirador.EnfileirarType(typeMetaInfo.Link, namespaceOwner, typeMetaInfo.Nome); } } }
public void ArmazenarType(TypeMetaInfo typeMetaInfo) { this.context.AddObject("Types", typeMetaInfo); this.context.SaveChanges(); }
public void ArmazenarType(TypeMetaInfo typeMetaInfo) { var existing = this.context .CreateQuery<TypeMetaInfo>("Types") .Where(n => n.PartitionKey == typeMetaInfo.PartitionKey) .Where(n => n.RowKey == typeMetaInfo.RowKey); if (existing.FirstOrDefault() == null) { this.context.AddObject("Types", typeMetaInfo); this.context.SaveChanges(); } }