private Guid GetTextEntityId(Guid enrchEmailDataId, bool isNewEnrichedData, MiningEntity entity) { if (!isNewEnrichedData) { return(GetTextEntityId(entity.GetHash(), enrchEmailDataId)); } return(entity.Id); }
private void CreateTextEntity(Guid enrchEmailDataId, MiningEntity textFact, EnrchTextEntityType factType, Guid parentId, EnrchTextEntitySource source = null, string hash = null) { Entity newTextEntity = _enrchTextEntitySchema.CreateEntity(_userConnection); newTextEntity.SetDefColumnValues(); newTextEntity.PrimaryColumnValue = textFact.Id; newTextEntity.SetColumnValue("EnrchEmailDataId", enrchEmailDataId); if (parentId != Guid.Empty) { newTextEntity.SetColumnValue("ParentId", parentId); } if (source != null) { newTextEntity.SetColumnValue("Source", source.ToString()); } newTextEntity.SetColumnValue("Type", factType.ToString()); newTextEntity.SetColumnValue("JsonData", JsonConvert.SerializeObject(textFact)); newTextEntity.SetColumnValue("Hash", hash ?? textFact.GetHash()); newTextEntity.SetColumnValue("HashVersion", textFact.GetHashVersion()); newTextEntity.Save(); }