Source/NFX/DataAccess/CRUD/Row.cs
/// <summary>
/// Factory method that makes an appropriate row type.For performance purposes,
///  this method does not check passed type for Row-derivation and returns null instead if type was invalid
/// </summary>
/// <param name="schema">Schema, which is used for creation of DynamicRows and their derivatives</param>
/// <param name="tRow">
/// A type of row to create, if the type is TypedRow-descending then a parameterless .ctor is called,
/// otherwise a type must have a .ctor that takes schema as a sole argument
/// </param>
/// <returns>
/// Row instance or null if wrong type was passed. For performance purposes,
///  this method does not check passed type for Row-derivation and returns null instead if type was invalid
/// </returns>
Factory method that makes an appropriate row type.For performance purposes,
this method does not check passed type for Row-derivation and returns null instead if type was invalid
Factory method that makes an appropriate row type . For performance purposes this method does not check passed type for Row - derivation and returns null instead if type was invalid
public static Row MakeRow(Schema schema, Type tRow = null)
          {
            if (tRow!=null && tRow != typeof(Row) && tRow != typeof(DynamicRow))
            {
                if (typeof(TypedRow).IsAssignableFrom(tRow))
                    return Activator.CreateInstance(tRow) as Row;
                else                                         
                    return Activator.CreateInstance(tRow, schema) as Row;
            }
            return new DynamicRow(schema);
          }
public static Row MakeRow ( Schema schema , Type tRow = null ) { if ( tRow != null && tRow != typeof ( Row ) && tRow != typeof ( DynamicRow ) ) { if ( typeof ( TypedRow ) . IsAssignableFrom ( tRow ) ) return Activator . CreateInstance ( tRow ) as Row ; else return Activator . CreateInstance ( tRow , schema ) as Row ; } return new DynamicRow ( schema ) ; }
Factory method that makes an appropriate row type.For performance purposes,
this method does not check passed type for Row-derivation and returns null instead if type was invalid
Factory method that makes an appropriate row type . For performance purposes this method does not check passed type for Row - derivation and returns null instead if type was invalid
//todo Compile do dynamic functors for speed
Row instance or null if wrong type was passed. For performance purposes,
this method does not check passed type for Row-derivation and returns null instead if type was invalid
Row instance or null if wrong type was passed . For performance purposes this method does not check passed type for Row - derivation and returns null instead if type was invalid
schema
Schema
Schema, which is used for creation of DynamicRows and their derivatives
Schema which is used for creation of DynamicRows and their derivatives
tRow
Type
A type of row to create, if the type is TypedRow-descending then a parameterless .ctor is called,
otherwise a type must have a .ctor that takes schema as a sole argument
A type of row to create if the type is TypedRow - descending then a parameterless . ctor is called otherwise a type must have a . ctor that takes schema as a sole argument