コード例 #1
0
 private void AppendORIDToField(DictionaryOrientDBEntity entity, string field, ORID orid)
 {
     if (entity.Fields.Keys.Contains(field))
     {
         entity.SetField(field, entity.GetField <HashSet <ORID> >(field).Add(orid));
     }
     else
     {
         var oridHashSet = new HashSet <ORID>();
         oridHashSet.Add(orid);
         entity.SetField(field, oridHashSet);
     }
 }
コード例 #2
0
        public IOCreateEdge Set <T>(string fieldName, T fieldValue)
        {
            if (_document == null)
            {
                _document = new DictionaryOrientDBEntity();
            }
            _document.SetField(fieldName, fieldValue);

            return(this);
        }
コード例 #3
0
        public static DictionaryOrientDBEntity ToDictionaryOrientDBEntity <T>(this T obj)
        {
            DictionaryOrientDBEntity entity = new DictionaryOrientDBEntity();
            var properties = obj.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);

            foreach (var property in properties)
            {
                entity.SetField(property.Name, property.GetValue(obj));
            }
            return(entity);
        }
コード例 #4
0
        public IOCreateDocument Set <T>(string fieldName, T fieldValue)
        {
            _document.SetField <T>(fieldName, fieldValue);

            return(this);
        }