Пример #1
0
 /// <summary>
 /// Creates a delegate that
 /// produces an instance of <typeparamref name="T"/> based an a <see cref="IDataRecord"/>.
 /// </summary>
 /// <param name="dataRecord">The <see cref="IDataRecord"/> that represents the available fields/columns.</param>
 /// <returns>A delegate that represents creating an instance of <typeparamref name="T"/>.</returns>
 public Func <IDataRecord, T> CreateInstanceDelegate(IDataRecord dataRecord)
 {
     return(cachedDelegate ?? (cachedDelegate = instanceDelegateBuilder.CreateInstanceDelegate(dataRecord)));
 }
Пример #2
0
 private T CreateInstance(IDataRecord dataRecord)
 {
     return(instanceDelegateBuilder.CreateInstanceDelegate(dataRecord)(dataRecord));
 }