Beispiel #1
0
        /// <summary>f
        /// Gets the <see cref="DataModelColumnAttribute"/> having the
        /// specified name and naming type.
        /// </summary>
        /// <param name="propertyNameOrColumnName"></param>
        /// <param name="keyType"></param>
        /// <returns></returns>
        public DataModelColumnAttribute this[string propertyNameOrColumnName, FieldMappingKeyType keyType]
        {
            get
            {
                switch (keyType)
                {
                case FieldMappingKeyType.ClrMember:
                    return(this.FieldMappings[propertyNameOrColumnName]);

                case FieldMappingKeyType.DbColumn:
                    return(this.GetFieldMappingByDbColumnName(propertyNameOrColumnName));
                }
                return(null);
            }
        }
Beispiel #2
0
 /// <summary>
 /// Constructs a SortItem using the specified field name.
 /// </summary>
 /// <param name="fieldName"></param>
 /// <param name="keyType">
 /// Determines whether to match the field
 /// name on the CLR member name or on the DB column
 /// name.
 /// </param>
 /// <param name="sortDirection"></param>
 public SortItem(string fieldName, FieldMappingKeyType keyType, Sort sortDirection)
 {
     FieldName = fieldName;
     FindFieldMappingKeyType = keyType;
     SortDirection           = sortDirection;
 }
Beispiel #3
0
 /// <summary>
 /// Constructs a SortItem using the specified field name.
 /// The <paramref name="keyType"/> parameter determines
 /// whether to match the field name on the CLR member name
 /// or on the DB column name.
 /// </summary>
 /// <param name="fieldName"></param>
 /// <param name="keyType">
 /// Determines whether to match the field
 /// name on the CLR member name or on the DB column
 /// name.
 /// </param>
 public SortItem(string fieldName, FieldMappingKeyType keyType)
     : this(fieldName, keyType, Sort.Ascending)
 {
 }
Beispiel #4
0
 /// <summary>
 /// Adds a field to the OrderBy collection
 /// </summary>
 /// <param name="fieldName"></param>
 /// <param name="keyType"></param>
 /// <param name="sortOrder"></param>
 /// <returns></returns>
 public DataModelQuery <TModel> AddSortItem(string fieldName, FieldMappingKeyType keyType, Sort sortOrder)
 {
     (OrderBy ?? (OrderBy = new List <SortItem>()))
     .Add(new SortItem(fieldName, keyType, sortOrder));
     return(this);
 }
Beispiel #5
0
 /// <summary>
 /// Adds a field to the OrderBy collection
 /// </summary>
 /// <param name="fieldName"></param>
 /// <param name="keyType"></param>
 /// <returns></returns>
 public new DataModelQuery <TModel> AddSortItem(string fieldName, FieldMappingKeyType keyType)
 {
     return(AddSortItem(fieldName, keyType, Sort.Ascending));
 }
        /// <summary>
        /// Constructs a QueryCondition&lt;T&gt; object using the specified
        /// parameters for describing the nature and for binding to the query.
        /// </summary>
        /// <param name="mapBy"></param>
        /// <param name="query"></param>
// ReSharper disable SuggestBaseTypeForParameter
        public DataModelQueryCondition(FieldMappingKeyType mapBy, DataModelQuery <TModel> query)
// ReSharper restore SuggestBaseTypeForParameter
        {
            _returnQuery       = query;
            FindFieldMappingBy = mapBy;
        }