Skip to content

Commit 3e4405c

Browse files
authored
Make properties readonly where possible (#658)
+semver:patch
1 parent 2c9a5a9 commit 3e4405c

19 files changed

+37
-37
lines changed

src/FluentNHibernate/Cfg/FluentConfigurationException.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ protected FluentConfigurationException(SerializationInfo info, StreamingContext
2020
this.PotentialReasons = info.GetValue("PotentialReasons", typeof(List<string>)) as List<string>;
2121
}
2222

23-
public IList<string> PotentialReasons { get; private set; }
23+
public IList<string> PotentialReasons { get; }
2424

2525
public override string Message
2626
{

src/FluentNHibernate/Cfg/MappingConfiguration.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,17 @@ public MappingConfiguration UsePersistenceModel(PersistenceModel persistenceMode
3737
/// <summary>
3838
/// Fluent mappings
3939
/// </summary>
40-
public FluentMappingsContainer FluentMappings { get; private set; }
40+
public FluentMappingsContainer FluentMappings { get; }
4141

4242
/// <summary>
4343
/// Automatic mapping configurations
4444
/// </summary>
45-
public AutoMappingsContainer AutoMappings { get; private set; }
45+
public AutoMappingsContainer AutoMappings { get; }
4646

4747
/// <summary>
4848
/// Hbm mappings
4949
/// </summary>
50-
public HbmMappingsContainer HbmMappings { get; private set; }
50+
public HbmMappingsContainer HbmMappings { get; }
5151

5252
/// <summary>
5353
/// Get whether any mappings of any kind were added

src/FluentNHibernate/Conventions/ConventionsCollection.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ public IEnumerable<object> this[Type type]
5555

5656
private class AddedConvention
5757
{
58-
public IList<object> Instances { get; private set; }
59-
public Type Type { get; private set; }
58+
public IList<object> Instances { get; }
59+
public Type Type { get; }
6060

6161
public AddedConvention(Type type)
6262
{

src/FluentNHibernate/Conventions/Inspections/ColumnInspector.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public ColumnInspector(Type containingEntityType, ColumnMapping mapping)
1414
this.mapping = mapping;
1515
}
1616

17-
public Type EntityType { get; private set; }
17+
public Type EntityType { get; }
1818

1919
public string Name => mapping.Name;
2020

src/FluentNHibernate/Diagnostics/DiagnosticResults.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ public DiagnosticResults(IEnumerable<ScannedSource> scannedSources, IEnumerable<
1717
AutomappedTypes = automappingTypes.ToArray();
1818
}
1919

20-
public IEnumerable<Type> FluentMappings { get; private set; }
21-
public IEnumerable<ScannedSource> ScannedSources { get; private set; }
22-
public IEnumerable<Type> Conventions { get; private set; }
23-
public IEnumerable<SkippedAutomappingType> AutomappingSkippedTypes { get; private set; }
24-
public IEnumerable<Type> AutomappingCandidateTypes { get; private set; }
25-
public IEnumerable<AutomappingType> AutomappedTypes { get; private set; }
20+
public IEnumerable<Type> FluentMappings { get; }
21+
public IEnumerable<ScannedSource> ScannedSources { get; }
22+
public IEnumerable<Type> Conventions { get; }
23+
public IEnumerable<SkippedAutomappingType> AutomappingSkippedTypes { get; }
24+
public IEnumerable<Type> AutomappingCandidateTypes { get; }
25+
public IEnumerable<AutomappingType> AutomappedTypes { get; }
2626
}

src/FluentNHibernate/Mapping/ClassMap.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ protected ClassMap(AttributeStore attributes, MappingProviderStore providers)
5555
/// <example>
5656
/// Cache.ReadWrite();
5757
/// </example>
58-
public CachePart Cache { get; private set; }
58+
public CachePart Cache { get; }
5959

6060
/// <summary>
6161
/// Specify settings for the container/hibernate-mapping for this class.

src/FluentNHibernate/Mapping/IdentityGenerationStrategyBuilder.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ public TParent Custom(string generator, Action<ParamBuilder> paramValues)
441441

442442
/// <summary>
443443
/// Generator that uses the RDBMS native function to generate a GUID.
444-
/// The behavior is similar to the “sequence” generator. When a new
444+
/// The behavior is similar to the sequence generator. When a new
445445
/// object is saved NH run two queries: the first to retrieve the GUID
446446
/// value and the second to insert the entity using the Guid retrieved
447447
/// from the RDBMS. Your entity Id must be System.Guid and the SQLType
@@ -457,7 +457,7 @@ public TParent GuidNative()
457457

458458
/// <summary>
459459
/// Generator that uses the RDBMS native function to generate a GUID.
460-
/// The behavior is similar to the “sequence” generator. When a new
460+
/// The behavior is similar to the sequence generator. When a new
461461
/// object is saved NH run two queries: the first to retrieve the GUID
462462
/// value and the second to insert the entity using the Guid retrieved
463463
/// from the RDBMS. Your entity Id must be System.Guid and the SQLType

src/FluentNHibernate/Mapping/IdentityPart.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ void SetDefaultAccess()
6060
/// Id("PersonId")
6161
/// .GeneratedBy.Assigned();
6262
/// </example>
63-
public IdentityGenerationStrategyBuilder<IdentityPart> GeneratedBy { get; private set; }
63+
public IdentityGenerationStrategyBuilder<IdentityPart> GeneratedBy { get; }
6464

6565
/// <summary>
6666
/// Set the access and naming strategy for this identity.

src/FluentNHibernate/Mapping/KeyManyToOnePart.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ public KeyManyToOnePart ForeignKey(string foreignKey)
3939
/// <summary>
4040
/// Defines how NHibernate will access the object for persisting/hydrating (Defaults to Property)
4141
/// </summary>
42-
public AccessStrategyBuilder<KeyManyToOnePart> Access { get; private set; }
42+
public AccessStrategyBuilder<KeyManyToOnePart> Access { get; }
4343

44-
public NotFoundExpression<KeyManyToOnePart> NotFound { get; private set; }
44+
public NotFoundExpression<KeyManyToOnePart> NotFound { get; }
4545

4646
public KeyManyToOnePart Lazy()
4747
{

src/FluentNHibernate/Mapping/KeyPropertyPart.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,5 @@ public KeyPropertyPart Length(int length)
4040
return this;
4141
}
4242

43-
public AccessStrategyBuilder<KeyPropertyPart> Access { get; private set; }
43+
public AccessStrategyBuilder<KeyPropertyPart> Access { get; }
4444
}

0 commit comments

Comments
 (0)