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


C# Row.GetValue方法代码示例

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


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

示例1: MapRowToVideoPreview

 /// <summary>
 /// Maps a row to a VideoPreview object.
 /// </summary>
 private static VideoPreview MapRowToVideoPreview(Row row)
 {
     return new VideoPreview
     {
         VideoId = row.GetValue<Guid>("videoid"),
         AddedDate = row.GetValue<DateTimeOffset>("added_date"),
         Name = row.GetValue<string>("name"),
         PreviewImageLocation = row.GetValue<string>("preview_image_location"),
         UserId = row.GetValue<Guid>("userid")
     };
 }
开发者ID:rustyrazorblade,项目名称:killrvideo-csharp,代码行数:14,代码来源:SearchVideosByTag.cs

示例2: MapRowToPlayStats

        private static PlayStats MapRowToPlayStats(Row row, Guid videoId)
        {
            // For null rows, just return an empty stats object with 0 views (since we won't have rows for a video until it has at least one view)
            if (row == null)
                return new PlayStats { VideoId = videoId, Views = 0 };

            return new PlayStats
            {
                VideoId = row.GetValue<Guid>("videoid"),
                Views = row.GetValue<long>("views")
            };
        }
开发者ID:rustyrazorblade,项目名称:killrvideo-csharp,代码行数:12,代码来源:StatisticsService.cs

示例3: Build

 /// <summary>
 /// Creates a new instance of function metadata based on a schema_function row.
 /// </summary>
 internal static AggregateMetadata Build(int protocolVersion, Row row)
 {
     var emptyArray = new string[0];
     var aggregate = new AggregateMetadata
     {
         Name = row.GetValue<string>("aggregate_name"),
         KeyspaceName = row.GetValue<string>("keyspace_name"),
         Signature = row.GetValue<string[]>("signature") ?? emptyArray,
         StateFunction = row.GetValue<string>("state_func"),
         StateType = TypeCodec.ParseDataType(row.GetValue<string>("state_type")),
         FinalFunction = row.GetValue<string>("final_func"),
         ReturnType = TypeCodec.ParseDataType(row.GetValue<string>("return_type")),
         ArgumentTypes = (row.GetValue<string[]>("argument_types") ?? emptyArray).Select(s => TypeCodec.ParseDataType(s)).ToArray(),
     };
     aggregate.InitialCondition = TypeCodec.Decode(protocolVersion, row.GetValue<byte[]>("initcond"), aggregate.StateType.TypeCode, aggregate.StateType.TypeInfo);
     return aggregate;
 }
开发者ID:raideroflostark,项目名称:csharp-driver,代码行数:20,代码来源:AggregateMetadata.cs

示例4: UpdateLocalInfo

 internal void UpdateLocalInfo(Row row)
 {
     var localhost = _host;
     // Update cluster name, DC and rack for the one node we are connected to
     var clusterName = row.GetValue<string>("cluster_name");
     if (clusterName != null)
     {
         Metadata.ClusterName = clusterName;
     }
     localhost.SetLocationInfo(row.GetValue<string>("data_center"), row.GetValue<string>("rack"));
     localhost.Tokens = row.GetValue<IEnumerable<string>>("tokens") ?? new string[0];
 }
开发者ID:raideroflostark,项目名称:csharp-driver,代码行数:12,代码来源:ControlConnection.cs

示例5: Build

 /// <summary>
 /// Creates a new instance of function metadata based on a schema_function row.
 /// </summary>
 internal static FunctionMetadata Build(Row row)
 {
     var emptyArray = new string[0];
     return new FunctionMetadata
     {
         Name = row.GetValue<string>("function_name"),
         KeyspaceName = row.GetValue<string>("keyspace_name"),
         Signature = row.GetValue<string[]>("signature") ?? emptyArray,
         ArgumentNames = row.GetValue<string[]>("argument_names") ?? emptyArray,
         Body = row.GetValue<string>("body"),
         CalledOnNullInput = row.GetValue<bool>("called_on_null_input"),
         Language = row.GetValue<string>("language"),
         ReturnType = TypeCodec.ParseDataType(row.GetValue<string>("return_type")),
         ArgumentTypes = (row.GetValue<string[]>("argument_types") ?? emptyArray).Select(s => TypeCodec.ParseDataType(s)).ToArray()
     };
 }
开发者ID:raideroflostark,项目名称:csharp-driver,代码行数:19,代码来源:FunctionMetadata.cs

示例6: SetCassandraVersion

 internal static void SetCassandraVersion(Host host, Row row)
 {
     try
     {
         var releaseVersion = row.GetValue<string>("release_version");
         if (releaseVersion != null)
         {
             host.CassandraVersion = Version.Parse(releaseVersion.Split('-')[0]);
         }
     }
     catch (Exception ex)
     {
         _logger.Error("There was an error while trying to retrieve the Cassandra version", ex);
     }
 }
开发者ID:jorgebay,项目名称:csharp-driver,代码行数:15,代码来源:ControlConnection.cs

示例7: MapRowToUserProfile

        private static UserProfile MapRowToUserProfile(Row row)
        {
            if (row == null) return null;

            return new UserProfile
            {
                UserId = row.GetValue<Guid>("userid"),
                FirstName = row.GetValue<string>("firstname"),
                LastName = row.GetValue<string>("lastname"),
                EmailAddress = row.GetValue<string>("email")
            };
        }
开发者ID:johnbabb,项目名称:killrvideo-csharp,代码行数:12,代码来源:UserManagementService.cs

示例8: FormTrigger

        private TriggerInfo FormTrigger(Row row)
        {
            var schema = row.GetValue(0).Value.ToString();
            var name = row.GetValue(1).Value.ToString();
            var triggerName = new ObjectName(new ObjectName(schema), name);

            var triggerType = (TriggerType)((SqlNumber)row.GetValue(2).Value).ToInt32();

            // TODO: In case it's  a procedural trigger, take the reference to the procedure
            if (triggerType == TriggerType.Procedure)
                throw new NotImplementedException();

            var tableName = ObjectName.Parse(((SqlString) row.GetValue(3).Value).ToString());
            var eventType = (TriggerEventType) ((SqlNumber) row.GetValue(4).Value).ToInt32();
            return  new TriggerInfo(triggerName, triggerType, eventType, tableName);
        }
开发者ID:furesoft,项目名称:deveeldb,代码行数:16,代码来源:TriggerManager.cs

示例9: ParseKeyspaceRow

 private KeyspaceMetadata ParseKeyspaceRow(Row row)
 {
     return new KeyspaceMetadata(
         ControlConnection, 
         row.GetValue<string>("keyspace_name"), 
         row.GetValue<bool>("durable_writes"), 
         row.GetValue<string>("strategy_class"), 
         Utils.ConvertStringToMapInt(row.GetValue<string>("strategy_options")));
 }
开发者ID:raideroflostark,项目名称:csharp-driver,代码行数:9,代码来源:Metadata.cs

示例10: MapRowToSkeletonItem

 private static InventorySkeletonEntry MapRowToSkeletonItem(Row row)
 {
     return new InventorySkeletonEntry
     {
         UserId = row.GetValue<Guid>("user_id"),
         FolderId = row.GetValue<Guid>("folder_id"),
         Name = row.GetValue<string>("folder_name"),
         ParentId = row.GetValue<Guid>("parent_id"),
         Type = (byte)row.GetValue<int>("type"),
         Level = (FolderLevel)row.GetValue<int>("level")
     };
 }
开发者ID:AlphaStaxLLC,项目名称:opensim-cql-inventory,代码行数:12,代码来源:CQLInventoryStorage.cs

示例11: MapRowToItem

 private static InventoryItem MapRowToItem(Row row)
 {
     return new InventoryItem
     {
         AssetId = row.GetValue<Guid>("asset_id"),
         AssetType = row.GetValue<int>("asset_type"),
         BasePermissions = row.GetValue<int>("base_permissions"),
         CreationDate = row.GetValue<int>("creation_date"),
         CreatorId = row.GetValue<Guid>("creator_id"),
         CurrentPermissions = row.GetValue<int>("current_permissions"),
         Description = row.GetValue<string>("description"),
         EveryonePermissions = row.GetValue<int>("everyone_permissions"),
         Flags = row.GetValue<int>("flags"),
         FolderId = row.GetValue<Guid>("folder_id"),
         GroupId = row.GetValue<Guid>("group_id"),
         GroupOwned = row.GetValue<bool>("group_owned"),
         GroupPermissions = row.GetValue<int>("group_permissions"),
         InventoryType = row.GetValue<int>("inv_type"),
         ItemId = row.GetValue<Guid>("item_id"),
         Name = row.GetValue<string>("name"),
         NextPermissions = row.GetValue<int>("next_permissions"),
         OwnerId = row.GetValue<Guid>("owner_id"),
         SaleType = row.GetValue<int>("sale_type")
     };
 }
开发者ID:AlphaStaxLLC,项目名称:opensim-cql-inventory,代码行数:25,代码来源:CQLInventoryStorage.cs

示例12: MapRowToFolder

 private static void MapRowToFolder(InventoryFolder retFolder, Row row)
 {
     retFolder.CreationDate = row.GetValue<int>("creation_date");
     retFolder.Name = row.GetValue<string>("name");
     retFolder.OwnerId = row.GetValue<Guid>("owner_id");
     retFolder.Type = row.GetValue<int>("inv_type");
 }
开发者ID:AlphaStaxLLC,项目名称:opensim-cql-inventory,代码行数:7,代码来源:CQLInventoryStorage.cs

示例13: SetValue

        internal void SetValue(Row row, object obj)
        {
            var colIndex = row.Table.TableInfo.IndexOfColumn(ColumnName);
            if (colIndex < 0)
                throw new InvalidOperationException(String.Format("The source table '{0}' has no column named '{1}'.",
                    row.Table.TableInfo.TableName, ColumnName));

            var value = row.GetValue(colIndex);
            if (Field.IsNullField(value)) {
                if (!IsNullable)
                    throw new InvalidOperationException(String.Format("Cannot set NULL to the non-nullable field '{0}' of {1}.",
                        Member.Name, Member.DeclaringType));
            }

            var memberValue = value.ConvertTo(MemberType);

            if (Member is PropertyInfo) {
                ((PropertyInfo)Member).SetValue(obj, memberValue, null);
            } else if (Member is FieldInfo) {
                ((FieldInfo)Member).SetValue(obj, memberValue);
            }
        }
开发者ID:deveel,项目名称:deveeldb,代码行数:22,代码来源:MemberMapInfo.cs

示例14: UpdateRow

                public void UpdateRow(Row row)
                {
                    if (row.RowId.RowNumber < 0 ||
                        row.RowId.RowNumber >= 1)
                        throw new ArgumentOutOfRangeException();
                    if (readOnly)
                        throw new NotSupportedException(String.Format("Updating '{0}' is not permitted.", tableInfo.TableName));

                    int sz = TableInfo.ColumnCount;
                    for (int i = 0; i < sz; ++i) {
                        data.SetValue(i, row.GetValue(i));
                    }
                }
开发者ID:ArsenShnurkov,项目名称:deveeldb,代码行数:13,代码来源:Transaction.cs

示例15: GetAddressForPeerHost

        /// <summary>
        /// Uses system.peers values to build the Address translator
        /// </summary>
        internal static IPEndPoint GetAddressForPeerHost(Row row, IAddressTranslator translator, int port)
        {
            var address = row.GetValue<IPAddress>("rpc_address");
            if (address == null)
            {
                return null;
            }
            if (BindAllAddress.Equals(address) && !row.IsNull("peer"))
            {
                address = row.GetValue<IPAddress>("peer");
                _logger.Warning(String.Format("Found host with 0.0.0.0 as rpc_address, using listen_address ({0}) to contact it instead. If this is incorrect you should avoid the use of 0.0.0.0 server side.", address));
            }

            return translator.Translate(new IPEndPoint(address, port));
        }
开发者ID:raideroflostark,项目名称:csharp-driver,代码行数:18,代码来源:ControlConnection.cs


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