当前位置: 首页>>代码示例>>C#>>正文


C# DBObjectStream.ContainsUndefinedAttribute方法代码示例

本文整理汇总了C#中DBObjectStream.ContainsUndefinedAttribute方法的典型用法代码示例。如果您正苦于以下问题:C# DBObjectStream.ContainsUndefinedAttribute方法的具体用法?C# DBObjectStream.ContainsUndefinedAttribute怎么用?C# DBObjectStream.ContainsUndefinedAttribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DBObjectStream的用法示例。


在下文中一共展示了DBObjectStream.ContainsUndefinedAttribute方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ApplyAssignUndefinedAttribute

        private Exceptional<Tuple<String, TypeAttribute, IObject>> ApplyAssignUndefinedAttribute(DBContext myDBContext, DBObjectStream myDBObjectStream, GraphDBType myGraphDBType)
        {
            Dictionary<String, Tuple<TypeAttribute, IObject>> attrsForResult = new Dictionary<String, Tuple<TypeAttribute, IObject>>();

            #region undefined attributes

            var newValue = GetValueForAttribute(myDBObjectStream, myDBContext, myGraphDBType);
            if (newValue.Failed())
            {
                return new Exceptional<Tuple<string, TypeAttribute, IObject>>(newValue);
            }

            if (myDBObjectStream.ContainsUndefinedAttribute(AttributeIDChain.UndefinedAttribute, myDBContext.DBObjectManager))
            {
                var removeResult =myDBObjectStream.RemoveUndefinedAttribute(AttributeIDChain.UndefinedAttribute, myDBContext.DBObjectManager);
                if (removeResult.Failed())
                {
                    return new Exceptional<Tuple<string, TypeAttribute, IObject>>(removeResult);
                }
            }

            //TODO: change this to a more handling thing than KeyValuePair
            var addExcept = myDBContext.DBObjectManager.AddUndefinedAttribute(AttributeIDChain.UndefinedAttribute, newValue.Value, myDBObjectStream);

            if (addExcept.Failed())
            {
                return new Exceptional<Tuple<String, TypeAttribute, IObject>>(addExcept);
            }

            //sthChanged = true;

            attrsForResult.Add(AttributeIDChain.UndefinedAttribute, new Tuple<TypeAttribute, IObject>(null, newValue.Value));

            #endregion

            return new Exceptional<Tuple<String, TypeAttribute, IObject>>(new Tuple<String, TypeAttribute, IObject>(AttributeIDChain.UndefinedAttribute, AttributeIDChain.LastAttribute, newValue.Value));
        }
开发者ID:Vadi,项目名称:sones,代码行数:37,代码来源:AAttributeAssignOrUpdate.cs


注:本文中的DBObjectStream.ContainsUndefinedAttribute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。