當前位置: 首頁>>代碼示例>>C#>>正文


C# InvokeMemberBinder.IsResultDiscarded方法代碼示例

本文整理匯總了C#中System.Dynamic.InvokeMemberBinder.IsResultDiscarded方法的典型用法代碼示例。如果您正苦於以下問題:C# InvokeMemberBinder.IsResultDiscarded方法的具體用法?C# InvokeMemberBinder.IsResultDiscarded怎麽用?C# InvokeMemberBinder.IsResultDiscarded使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Dynamic.InvokeMemberBinder的用法示例。


在下文中一共展示了InvokeMemberBinder.IsResultDiscarded方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: DoInsert

        private static object DoInsert(InvokeMemberBinder binder, object[] args, DataStrategy dataStrategy, string tableName)
        {
            if (binder.HasSingleUnnamedArgument())
            {
                return InsertEntity(args[0], dataStrategy, tableName, (r,e) => false, !binder.IsResultDiscarded());
            }

            if (args.Length == 2)
            {
                var onError = args[1] as ErrorCallback;
                if (onError != null)
                {
                    return InsertEntity(args[0], dataStrategy, tableName, onError, !binder.IsResultDiscarded());
                }
            }
            return InsertDictionary(binder, args, dataStrategy, tableName);
        }
開發者ID:hlach,項目名稱:Simple.Data,代碼行數:17,代碼來源:InsertCommand.cs

示例2: Execute

        public object Execute(DataStrategy dataStrategy, DynamicTable table, InvokeMemberBinder binder, object[] args)
        {
            object result;

            if (binder.HasSingleUnnamedArgument() || args.Length == 2 && args[1] is ErrorCallback)
            {
                result = UpsertByKeyFields(table.GetQualifiedName(), dataStrategy, args[0],
                                         MethodNameParser.ParseCriteriaNamesFromMethodName(binder.Name),
                                         !binder.IsResultDiscarded(),
                                         args.Length == 2 ? (ErrorCallback)args[1] : ((item, exception) => false));
            }
            else
            {
                var criteria = MethodNameParser.ParseFromBinder(binder, args);
                var criteriaExpression = ExpressionHelper.CriteriaDictionaryToExpression(table.GetQualifiedName(),
                                                                                         criteria);
                var data = binder.NamedArgumentsToDictionary(args);
                result = dataStrategy.Upsert(table.GetQualifiedName(), data, criteriaExpression, !binder.IsResultDiscarded());
            }

            return ResultHelper.TypeResult(result, table, dataStrategy);
        }
開發者ID:hlach,項目名稱:Simple.Data,代碼行數:22,代碼來源:UpsertByCommand.cs

示例3: Execute

        public object Execute(DataStrategy dataStrategy, DynamicTable table, InvokeMemberBinder binder, object[] args)
        {
            object[] objects;
            if (binder.CallInfo.ArgumentNames.Count > 0 && binder.CallInfo.ArgumentNames.All(s => !string.IsNullOrWhiteSpace(s)))
            {
                objects = new object[] {binder.NamedArgumentsToDictionary(args)};
            }
            else if (args.Length == 0 || args.Length > 2)
            {
                throw new ArgumentException("Incorrect number of arguments to Upsert method.");
            }
            else
            {
                objects = args;
            }

            var result = UpsertUsingKeys(dataStrategy, table, objects, !binder.IsResultDiscarded());

            return ResultHelper.TypeResult(result, table, dataStrategy);
        }
開發者ID:remcok,項目名稱:Simple.Data,代碼行數:20,代碼來源:UpsertCommand.cs

示例4: InsertDictionary

 private static object InsertDictionary(InvokeMemberBinder binder, object[] args, DataStrategy dataStrategy, string tableName)
 {
     return dataStrategy.Insert(tableName, binder.NamedArgumentsToDictionary(args), !binder.IsResultDiscarded());
 }
開發者ID:hlach,項目名稱:Simple.Data,代碼行數:4,代碼來源:InsertCommand.cs


注:本文中的System.Dynamic.InvokeMemberBinder.IsResultDiscarded方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。