本文整理汇总了C#中Row.Field方法的典型用法代码示例。如果您正苦于以下问题:C# Row.Field方法的具体用法?C# Row.Field怎么用?C# Row.Field使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Row
的用法示例。
在下文中一共展示了Row.Field方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetAffectedRows
///<summary>Gets the row(s) affected by a change in a row.</summary>
///<returns>The parent row of the child row that was changed.</returns>
protected override IEnumerable<Row> GetAffectedRows(Row modifiedRow, Table owner)
{
if (modifiedRow == null) throw new ArgumentNullException("modifiedRow");
//When a child row changes, its parent is affected,
//unless the child row doesn't have a parent.
var affectedRow = modifiedRow.Field<Row>(ChildRelation.ChildColumn);
if (affectedRow != null)
yield return affectedRow;
}
示例2: PersonData
///<summary>Constructs a new PersonData from a Singularity Row.</summary>
///<param name="ykRow">Any ykRow with the standard set of fields.</param>
public PersonData(Row row)
{
if (row == null)
throw new ArgumentNullException("row");
FullName = row.Field<string>("FullName");
HisName = row.Field<string>("HisName");
HerName = row.Field<string>("HerName");
LastName = row.Field<string>("LastName");
Address = row.Field<string>("Address");
City = row.Field<string>("City");
State = row.Field<string>("State");
Zip = row.Field<string>("Zip");
pPhone = row.Field<string>("Phone");
}
示例3: GetColumnValue
static object GetColumnValue(Row row, Column column)
{
var foreignKey = column as ForeignKeyColumn;
if (foreignKey == null)
return row[column];
if (foreignKey.ForeignSchema.PrimaryKey == null)
throw new InvalidOperationException("A foreign key column that references a table without a primary key cannot be saved to a SQL database");
var foreignRow = row.Field<Row>(column);
if (foreignRow == null) return null;
return foreignRow[foreignKey.ForeignSchema.PrimaryKey];
}