public IEnumerable <IDbDataParameter> ExtractParameters(TableObjectMapping tableFieldInfo, bool ignoreIdentity) { if (tableFieldInfo.IsNull() || tableFieldInfo.FieldMappings.IsNullOrEmpty()) { return(Enumerable.Empty <IDbDataParameter>()); } return(tableFieldInfo .FieldMappings .Select(f => f.Value) .Where(f => !ignoreIdentity || !f.IsIdentity) .SafeSelect(f => new SqlParameter(f.ParameterName, f.DbType) { Value = f.Value.IsNull() ? DBNull.Value : f.Value }) .ToList()); }
public QueryInfo(string query, TableObjectMapping tableObjectMapping = null, IEnumerable <IDbDataParameter> parameters = null) : this(query, new[] { tableObjectMapping }, parameters) { }