public static bool IngestColumnTable(IColumnRecord <ChinaOpalSearch.EntityID> record) { using (var client = Client.Builder <ChinaOpalSearch.EntityID, ChinaOpalSearch.SnappsEntity>( environment: Config.environment, osNamespace: Config.osNamespace, osTable: Config.osTable, timeout: new TimeSpan(0, 0, 0, 500), maxRetries: 3).Create()) { var task = client.ColumnWrite(new List <IColumnRecord <ChinaOpalSearch.EntityID> > { record }).SendAsync(); try { task.Wait(); return(true); } catch (Exception e) { Console.WriteLine(e.Message); return(false); } } }
static SnappsEntity ConstructSnappsEntity(IColumnRecord <EntityID> record) { SnappsEntity res = new SnappsEntity(); string Name; record.GetColumnValue <string>("Name", null, out Name); res.Name = Name; List <string> Alias; record.GetColumnValue <List <string> >("Alias", null, out Alias); res.Alias = Alias; string KgId; record.GetColumnValue <string>("KgId", null, out KgId); res.KgId = KgId; string Description; record.GetColumnValue <string>("Description", null, out Description); res.Description = Description; List <string> Segments; record.GetColumnValue <List <string> >("Segments", null, out Segments); res.Segments = Segments; List <string> Categories; record.GetColumnValue <List <string> >("Categories", null, out Categories); res.Categories = Categories; Dictionary <string, string> Filters; record.GetColumnValue <Dictionary <string, string> >("Filters", null, out Filters); res.Filters = Filters; List <string> Geographies; record.GetColumnValue <List <string> >("Geographies", null, out Geographies); res.Geographies = Geographies; uint Popularity; record.GetColumnValue <uint>("Popularity", null, out Popularity); res.Popularity = Popularity; uint RatingCount; record.GetColumnValue <uint>("RatingCount", null, out RatingCount); res.RatingCount = RatingCount; uint Rating; record.GetColumnValue <uint>("Rating", null, out Rating); res.Rating = Rating; uint ReviewCount; record.GetColumnValue <uint>("ReviewCount", null, out ReviewCount); res.ReviewCount = ReviewCount; uint VisitCount; record.GetColumnValue <uint>("VisitCount", null, out VisitCount); res.VisitCount = VisitCount; uint Rank; record.GetColumnValue <uint>("Rank", null, out Rank); res.Rank = Rank; uint PublishDate; record.GetColumnValue <uint>("PublishDate", null, out PublishDate); res.PublishDate = PublishDate; uint UpdateDate; record.GetColumnValue <uint>("UpdateDate", null, out UpdateDate); res.UpdateDate = UpdateDate; uint EndDate; record.GetColumnValue <uint>("EndDate", null, out EndDate); res.EndDate = EndDate; uint Length; record.GetColumnValue <uint>("Length", null, out Length); res.Length = Length; uint QueryRank; record.GetColumnValue <uint>("QueryRank", null, out QueryRank); res.QueryRank = QueryRank; Dictionary <string, string> ImageUrls; record.GetColumnValue <Dictionary <string, string> >("ImageUrls", null, out ImageUrls); res.ImageUrls = ImageUrls; Dictionary <string, string> SourceUrls; record.GetColumnValue <Dictionary <string, string> >("SourceUrls", null, out SourceUrls); res.SourceUrls = SourceUrls; string OfficialSite; record.GetColumnValue <string>("OfficialSite", null, out OfficialSite); res.OfficialSite = OfficialSite; string Logo; record.GetColumnValue <string>("Logo", null, out Logo); res.Logo = Logo; Entertainment Entment; record.GetColumnValue <Entertainment>("Entment", null, out Entment); res.Entment = Entment; return(res); }