Skip to content

Commit e8df11c

Browse files
committed
Fix build
1 parent 2d0c485 commit e8df11c

File tree

12 files changed

+17
-22
lines changed

12 files changed

+17
-22
lines changed

Orm/Xtensive.Orm/Core/LockableBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public void EnsureNotLocked()
4545
/// Initializes new instance of this type.
4646
/// </summary>
4747
/// <param name="isLocked">Initial <see cref="IsLocked"/> property value.</param>
48-
protected LockableBase(bool isLocked)
48+
protected LockableBase(bool isLocked = false)
4949
{
5050
IsLocked = isLocked;
5151
}

Orm/Xtensive.Orm/Linq/ExpressionWriter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ protected virtual string GetTypeName(Type type)
300300

301301
if (name.IndexOf("__AnonymousType", StringComparison.Ordinal) > 0 &&
302302
type.GetAttributes<CompilerGeneratedAttribute>(AttributeSearchOptions.InheritNone).Count > 0) {
303-
return $"@<{(from pi in TypeHelper.GetProperties(type) select pi.Name).ToCommaDelimitedString()}>";
303+
return $"@<{(from pi in type.GetProperties() select pi.Name).ToCommaDelimitedString()}>";
304304
}
305305

306306
return name;

Orm/Xtensive.Orm/Modelling/Node.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,7 @@ static Lazy<PropertyAccessorDictionary> PropertyAccessorExtractor(Type entityTyp
864864

865865
const BindingFlags propertyBindingFlags =
866866
BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly;
867-
foreach (var p in TypeHelper.GetProperties(entityType, propertyBindingFlags)) {
867+
foreach (var p in entityType.GetProperties(propertyBindingFlags)) {
868868
if (p.GetAttribute<PropertyAttribute>(AttributeSearchOptions.InheritNone) != null) {
869869
d.Add(p.Name, new PropertyAccessor(p));
870870
}

Orm/Xtensive.Orm/Orm/Building/Builders/ModelBuilder.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,8 @@ private void BuildTypes(IReadOnlyList<TypeDef> typeDefs)
188188
typeBuilder.BuildType(typeDef);
189189
}
190190
}
191-
using (BuildLog.InfoRegion(nameof(Strings.LogBuildingX), "Fields"))
191+
var typeInfoCollection = context.Model.Types;
192+
using (BuildLog.InfoRegion(nameof(Strings.LogBuildingX), "Fields")) {
192193
foreach (var typeDef in typeDefs) {
193194
var typeInfo = typeInfoCollection[typeDef.UnderlyingType];
194195
typeBuilder.BuildFields(typeDef, typeInfo);

Orm/Xtensive.Orm/Orm/Building/Builders/ModelDefBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ private void ProcessFullTextIndexes(TypeDef typeDef)
136136

137137
public void ProcessProperties(TypeDef typeDef, HierarchyDef hierarchyDef)
138138
{
139-
var properties = TypeHelper.GetProperties(typeDef.UnderlyingType, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
139+
var properties = typeDef.UnderlyingType.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
140140

141141
foreach (var propertyInfo in properties
142142
.Where(IsFieldAvailable)) { // Domain builder stage-related filter

Orm/Xtensive.Orm/Orm/Linq/QueryHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public static Expression CreateDirectEntitySetQuery(EntitySetBase entitySet)
9090
if (!entitySet.Field.IsDynamicallyDefined) {
9191
return Expression.Property(wrappedOwner, entitySet.Field.UnderlyingProperty);
9292
}
93-
var indexers = TypeHelper.GetProperties(owner.GetType(), BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public)
93+
var indexers = owner.GetType().GetProperties(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public)
9494
.Where(p => p.GetIndexParameters().Any())
9595
.Select(p => p.GetGetMethod());
9696
return Expression.Convert(Expression.Call(Expression.Constant(owner),indexers.Single(), new []{Expression.Constant(entitySet.Field.Name)}), entitySet.Field.ValueType);

Orm/Xtensive.Orm/Orm/Linq/Rewriters/PersistentIndexerRewriter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ private Expression GetMemberExpression(MethodCallExpression mc)
7272
if (mc.Object != visitedObject)
7373
mc = Expression.Call(visitedObject, mc.Method, mc.Arguments);
7474

75-
var propertyInfo = TypeHelper.GetProperties(mc.Object.Type, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)
75+
var propertyInfo = mc.Object.Type.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)
7676
.SingleOrDefault(property => property.Name==name);
7777
if (propertyInfo!=null)
7878
return Expression.MakeMemberAccess(mc.Object, propertyInfo);

Orm/Xtensive.Orm/Orm/Linq/Translator.Expressions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,7 +1027,7 @@ private IList<Expression> GetStructureFields(
10271027

10281028
var result = new List<Expression>();
10291029
foreach (PersistentFieldExpression fieldExpression in structureFields) {
1030-
if (!TypeHelper.GetProperties(structureType, BindingFlags.Instance | BindingFlags.Public).Contains(fieldExpression.UnderlyingProperty)) {
1030+
if (!structureType.GetProperties(BindingFlags.Instance | BindingFlags.Public).Contains(fieldExpression.UnderlyingProperty)) {
10311031
if (!context.Model.Types[structureType].Fields[fieldExpression.Name].IsDynamicallyDefined) {
10321032
continue;
10331033
}
@@ -1282,15 +1282,15 @@ private static IList<Expression> GetAnonymousArguments(Expression expression, Ty
12821282
if (constantExpression.Value==null && constantExpression.Type==WellKnownTypes.Object) {
12831283
var newConstantExpressionType = anonymousTypeForNullValues ?? constantExpression.Type;
12841284
constantExpression = Expression.Constant(null, newConstantExpressionType);
1285-
return TypeHelper.GetProperties(constantExpression.Type)
1285+
return constantExpression.Type.GetProperties()
12861286
.OrderBy(property => property.Name)
12871287
.Select(p => Expression.MakeMemberAccess(constantExpression, p))
12881288
.Cast<Expression>()
12891289
.ToList();
12901290
}
12911291
}
12921292

1293-
return TypeHelper.GetProperties(expression.Type)
1293+
return expression.Type.GetProperties()
12941294
.OrderBy(property => property.Name)
12951295
.Select(p => Expression.MakeMemberAccess(expression, p))
12961296
.Select(e => (Expression) e)

Orm/Xtensive.Orm/Orm/Logging/IndentManager.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ public struct IndentScope : IDisposable
2121

2222
public void Dispose()
2323
{
24-
if (disposed)
25-
return;
26-
disposed = true;
2724
CurrentIndentLengthAsync.Value = oldIndent;
2825
endAction?.Invoke();
2926
}
@@ -32,7 +29,6 @@ public IndentScope(int oldIndent, Action endAction)
3229
{
3330
this.oldIndent = oldIndent;
3431
this.endAction = endAction;
35-
disposed = false;
3632
}
3733
}
3834

Orm/Xtensive.Orm/Orm/Upgrade/UpgradeHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ from h in hints
371371

372372
var recycledProperties =
373373
from t in registeredTypes
374-
from p in TypeHelper.GetProperties(t, BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)
374+
from p in t.GetProperties(BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)
375375
let pa = p.GetAttribute<FieldAttribute>()
376376
let ra = p.GetAttribute<RecycledAttribute>()
377377
where pa!=null && ra!=null

0 commit comments

Comments
 (0)