예제 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SessionQueryInfo"/> class.
 /// </summary>
 /// <param name="source">The source.</param>
 /// <param name="childMappings">The child mappings.</param>
 /// <param name="parentMappings">The parent mappings.</param>
 public SessionQueryInfo(IMappingSource source, IMapping[] childMappings, IMapping[] parentMappings)
 {
     ChildMappings     = childMappings;
     ParentMappings    = parentMappings;
     AssociatedMapping = System.Array.Find(ParentMappings, x => x.IDProperties.Count > 0);
     Source            = source;
     IDProperties      = ParentMappings.SelectMany(x => x.IDProperties).ToArray();
     IDColumnInfo      = IDProperties.SelectMany(x => x.GetColumnInfo()).ToArray();
 }
예제 #2
0
 /// <summary>
 /// Generates the parameters.
 /// </summary>
 /// <param name="queryObject">The query object.</param>
 /// <returns>The parameters</returns>
 private IParameter?[] GenerateParameters(TMappedClass queryObject) => IDProperties.SelectMany(x => x.GetColumnInfo().Select(y => y.GetAsParameter(queryObject))).ToArray();