mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-21 05:53:33 -07:00
removed redundant qualifiers.
This commit is contained in:
parent
50f66cbcca
commit
e89a35522e
35 changed files with 128 additions and 106 deletions
|
@ -1,4 +1,6 @@
|
|||
namespace Marr.Data.Mapping
|
||||
using System.Data;
|
||||
|
||||
namespace Marr.Data.Mapping
|
||||
{
|
||||
public class ColumnInfo : IColumnInfo
|
||||
{
|
||||
|
@ -7,7 +9,7 @@
|
|||
IsPrimaryKey = false;
|
||||
IsAutoIncrement = false;
|
||||
ReturnValue = false;
|
||||
ParamDirection = System.Data.ParameterDirection.Input;
|
||||
ParamDirection = ParameterDirection.Input;
|
||||
}
|
||||
|
||||
public string Name { get; set; }
|
||||
|
@ -16,7 +18,7 @@
|
|||
public bool IsPrimaryKey { get; set; }
|
||||
public bool IsAutoIncrement { get; set; }
|
||||
public bool ReturnValue { get; set; }
|
||||
public System.Data.ParameterDirection ParamDirection { get; set; }
|
||||
public ParameterDirection ParamDirection { get; set; }
|
||||
|
||||
public string TryGetAltName()
|
||||
{
|
||||
|
|
|
@ -30,12 +30,12 @@ namespace Marr.Data.Mapping
|
|||
|
||||
public ColumnMap GetByColumnName(string columnName)
|
||||
{
|
||||
return this.Find(m => m.ColumnInfo.Name == columnName);
|
||||
return Find(m => m.ColumnInfo.Name == columnName);
|
||||
}
|
||||
|
||||
public ColumnMap GetByFieldName(string fieldName)
|
||||
{
|
||||
return this.Find(m => m.FieldName == fieldName);
|
||||
return Find(m => m.FieldName == fieldName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -107,7 +107,7 @@ namespace Marr.Data.Mapping
|
|||
/// <returns>A list of mapped columns that are present in the sql statement as parameters.</returns>
|
||||
public ColumnMapCollection OrderParameters(DbCommand command)
|
||||
{
|
||||
if (command.CommandType == CommandType.Text && this.Count > 0)
|
||||
if (command.CommandType == CommandType.Text && Count > 0)
|
||||
{
|
||||
string commandTypeString = command.GetType().ToString();
|
||||
if (commandTypeString.Contains("Oracle") || commandTypeString.Contains("OleDb"))
|
||||
|
@ -120,7 +120,7 @@ namespace Marr.Data.Mapping
|
|||
Regex regex = new Regex(regexString);
|
||||
foreach (Match m in regex.Matches(command.CommandText))
|
||||
{
|
||||
ColumnMap matchingColumn = this.Find(c => string.Concat(paramPrefix, c.ColumnInfo.Name.ToLower()) == m.Value.ToLower());
|
||||
ColumnMap matchingColumn = Find(c => string.Concat(paramPrefix, c.ColumnInfo.Name.ToLower()) == m.Value.ToLower());
|
||||
if (matchingColumn != null)
|
||||
columns.Add(matchingColumn);
|
||||
}
|
||||
|
@ -148,7 +148,7 @@ namespace Marr.Data.Mapping
|
|||
/// <returns></returns>
|
||||
public ColumnMapCollection PrefixAltNames(string prefix)
|
||||
{
|
||||
this.ForEach(c => c.ColumnInfo.AltName = c.ColumnInfo.Name.Insert(0, prefix));
|
||||
ForEach(c => c.ColumnInfo.AltName = c.ColumnInfo.Name.Insert(0, prefix));
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -163,7 +163,7 @@ namespace Marr.Data.Mapping
|
|||
/// <returns></returns>
|
||||
public ColumnMapCollection SuffixAltNames(string suffix)
|
||||
{
|
||||
this.ForEach(c => c.ColumnInfo.AltName = c.ColumnInfo.Name + suffix);
|
||||
ForEach(c => c.ColumnInfo.AltName = c.ColumnInfo.Name + suffix);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
|
@ -55,9 +55,9 @@ namespace Marr.Data.Mapping
|
|||
public class MappingsFluentColumns<TEntity>
|
||||
{
|
||||
private bool _publicOnly;
|
||||
private FluentMappings.MappingsFluentEntity<TEntity> _fluentEntity;
|
||||
private MappingsFluentEntity<TEntity> _fluentEntity;
|
||||
|
||||
public MappingsFluentColumns(FluentMappings.MappingsFluentEntity<TEntity> fluentEntity, bool publicOnly)
|
||||
public MappingsFluentColumns(MappingsFluentEntity<TEntity> fluentEntity, bool publicOnly)
|
||||
{
|
||||
_fluentEntity = fluentEntity;
|
||||
_publicOnly = publicOnly;
|
||||
|
@ -122,9 +122,9 @@ namespace Marr.Data.Mapping
|
|||
|
||||
public class MappingsFluentTables<TEntity>
|
||||
{
|
||||
private FluentMappings.MappingsFluentEntity<TEntity> _fluentEntity;
|
||||
private MappingsFluentEntity<TEntity> _fluentEntity;
|
||||
|
||||
public MappingsFluentTables(FluentMappings.MappingsFluentEntity<TEntity> fluentEntity)
|
||||
public MappingsFluentTables(MappingsFluentEntity<TEntity> fluentEntity)
|
||||
{
|
||||
_fluentEntity = fluentEntity;
|
||||
}
|
||||
|
@ -152,10 +152,10 @@ namespace Marr.Data.Mapping
|
|||
|
||||
public class MappingsFluentRelationships<TEntity>
|
||||
{
|
||||
private FluentMappings.MappingsFluentEntity<TEntity> _fluentEntity;
|
||||
private MappingsFluentEntity<TEntity> _fluentEntity;
|
||||
private bool _publicOnly;
|
||||
|
||||
public MappingsFluentRelationships(FluentMappings.MappingsFluentEntity<TEntity> fluentEntity, bool publicOnly)
|
||||
public MappingsFluentRelationships(MappingsFluentEntity<TEntity> fluentEntity, bool publicOnly)
|
||||
{
|
||||
_fluentEntity = fluentEntity;
|
||||
_publicOnly = publicOnly;
|
||||
|
|
|
@ -14,6 +14,7 @@ You should have received a copy of the GNU Lesser General Public
|
|||
License along with this library. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Reflection;
|
||||
using Marr.Data.Reflection;
|
||||
|
||||
|
@ -35,7 +36,7 @@ namespace Marr.Data.Mapping
|
|||
// Try to determine the RelationshipType
|
||||
if (relationshipInfo.RelationType == RelationshipTypes.AutoDetect)
|
||||
{
|
||||
if (typeof(System.Collections.ICollection).IsAssignableFrom(MemberType))
|
||||
if (typeof(ICollection).IsAssignableFrom(MemberType))
|
||||
{
|
||||
relationshipInfo.RelationType = RelationshipTypes.Many;
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ namespace Marr.Data.Mapping
|
|||
{
|
||||
get
|
||||
{
|
||||
return this.Find(m => m.Member.Name == fieldName);
|
||||
return Find(m => m.Member.Name == fieldName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ namespace Marr.Data.Mapping.Strategies
|
|||
|
||||
|
||||
|
||||
protected override void CreateColumnMap(Type entityType, System.Reflection.MemberInfo member, ColumnAttribute columnAtt, ColumnMapCollection columnMaps)
|
||||
protected override void CreateColumnMap(Type entityType, MemberInfo member, ColumnAttribute columnAtt, ColumnMapCollection columnMaps)
|
||||
{
|
||||
if (ColumnPredicate(member))
|
||||
{
|
||||
|
@ -36,7 +36,7 @@ namespace Marr.Data.Mapping.Strategies
|
|||
}
|
||||
}
|
||||
|
||||
protected override void CreateRelationship(Type entityType, System.Reflection.MemberInfo member, RelationshipAttribute relationshipAtt, RelationshipCollection relationships)
|
||||
protected override void CreateRelationship(Type entityType, MemberInfo member, RelationshipAttribute relationshipAtt, RelationshipCollection relationships)
|
||||
{
|
||||
if (RelationshipPredicate(member))
|
||||
{
|
||||
|
|
|
@ -14,6 +14,7 @@ You should have received a copy of the GNU Lesser General Public
|
|||
License along with this library. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Marr.Data.Mapping.Strategies
|
||||
|
@ -70,7 +71,7 @@ namespace Marr.Data.Mapping.Strategies
|
|||
if (member.MemberType == MemberTypes.Property)
|
||||
{
|
||||
PropertyInfo propertyInfo = member as PropertyInfo;
|
||||
if (typeof(System.Collections.ICollection).IsAssignableFrom(propertyInfo.PropertyType))
|
||||
if (typeof(ICollection).IsAssignableFrom(propertyInfo.PropertyType))
|
||||
{
|
||||
Relationship relationship = new Relationship(member);
|
||||
relationships.Add(relationship);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue