diff --git a/CHANGELOG.md b/CHANGELOG.md index 2eb7f71987..37a0bbb52b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## vNext (TBD) +## 11.1.0 (2023-06-17) ### Enhancements * Deprecate the `Realm.SourceGenerator` and `Realm.Fody` packages. The source generation and weaver assemblies are now contained in the main `Realm` package. This should be a transparent change for users who only referenced the `Realm` package, but if you explicitly added a package reference to `Realm.SourceGenerator` or `Realm.Fody`, you should remove it. (PR [#3319](https://github.com/realm/realm-dotnet/pull/3319)) diff --git a/Docs/docfx.json b/Docs/docfx.json index 79cfac2b4d..8b7e66f288 100644 --- a/Docs/docfx.json +++ b/Docs/docfx.json @@ -15,7 +15,10 @@ } ], "dest": "obj/temp/api", - "filter": "filterConfig.yml" + "filter": "filterConfig.yml", + "properties": { + "TargetFramework": "netstandard2.0" + } } ], "build": { @@ -65,7 +68,9 @@ ] } ], - "xrefService": [ "https://xref.docs.microsoft.com/query?uid={uid}" ], + "xrefService": [ + "https://xref.docs.microsoft.com/query?uid={uid}" + ], "dest": "_site", "globalMetadataFiles": [], "globalMetadata": { @@ -88,7 +93,10 @@ "../CHANGELOG.md": true } }, - "template": [ "default", "template" ], + "template": [ + "default", + "template" + ], "postProcessors": [], "noLangKeyword": false, "properties": { diff --git a/Docs/filterConfig.yml b/Docs/filterConfig.yml index df74f36e47..6a0777572a 100644 --- a/Docs/filterConfig.yml +++ b/Docs/filterConfig.yml @@ -101,6 +101,9 @@ apiRules: - exclude: uidRegex: ^Realms\.Schema\.RealmSchema\.Builder\.GetKey type: Method +- exclude: + uidRegex: ^Realms\.Sync\.Testing\.TestingExtensions + type: Type - include: hasAttribute: uid: System.ComponentModel.EditorBrowsableAttribute diff --git a/Docs/linqsupport.md b/Docs/linqsupport.md index 7df8a23b91..34723a2ea0 100644 --- a/Docs/linqsupport.md +++ b/Docs/linqsupport.md @@ -16,7 +16,7 @@ var oldDogs = realm.All().Where(dog => dog.Age > 8); ``` ## Ordering Operators -[`OrderBy`](xref:System.Linq.Queryable.OrderBy``2(System.Linq.IQueryable{``0},System.Linq.Expressions.Expression{System.Func{``0,``1}})), [`OrderByDescending`](xref:System.Linq.Queryable.OrderByDescending``2(System.Linq.IQueryable{``0},System.Linq.Expressions.Expression{System.Func{``0,``1}})), [`Thenby`](xref:System.Linq.Queryable.ThenBy``2(System.Linq.IOrderedQueryable{``0},System.Linq.Expressions.Expression{System.Func{``0,``1}})), and [`ThenByDescending`](xref:System.Linq.Queryable.ThenByDescending``2(System.Linq.IOrderedQueryable{``0},System.Linq.Expressions.Expression{System.Func{``0,``1}})) are all supported. [`Reverse`](xref:System.Linq.Queryable.Reverse``1(System.Linq.IQueryable{``0})) is not yet supported. Currently, you can only order by persisted properties on the class that you are querying. This means that `dogs.OrderBy(dog => dog.Owner.FirstName)` and the like is not yet supported. +[`OrderBy`](xref:System.Linq.Queryable.OrderBy``2(System.Linq.IQueryable{``0},System.Linq.Expressions.Expression{System.Func{``0,``1}})), [`OrderByDescending`](xref:System.Linq.Queryable.OrderByDescending``2(System.Linq.IQueryable{``0},System.Linq.Expressions.Expression{System.Func{``0,``1}})), [`Thenby`](xref:System.Linq.Queryable.ThenBy``2(System.Linq.IOrderedQueryable{``0},System.Linq.Expressions.Expression{System.Func{``0,``1}})), and [`ThenByDescending`](xref:System.Linq.Queryable.ThenByDescending``2(System.Linq.IOrderedQueryable{``0},System.Linq.Expressions.Expression{System.Func{``0,``1}})) are all supported. [`Reverse`](xref:System.Linq.Queryable.Reverse``1(System.Linq.IQueryable{``0})) is not yet supported. Currently, you can only order by persisted properties on the class that you are querying. This means that `dogs.OrderBy(dog => dog.Owner.FirstName)` and the like is not yet supported. Example: @@ -55,10 +55,10 @@ Note that, as is standard C# behaviour of [default(T)](https://msdn.microsoft.co [`Any`](xref:System.Linq.Queryable.Any*) takes an optional predicate. To see the supported operations for predicates in Realm queries, refer to the [Predicate Operations](#predicate-operations) section. -## Aggregate Operators +## Aggregate Operators [`Count`](xref:System.Linq.Queryable.Count*) is supported. -[`LongCount`](xref:System.Linq.Queryable.LongCount*), [`Sum`](xref:System.Linq.Queryable.Sum*), [`Min`](xref:System.Linq.Queryable.Min*), [`Max`](xref:System.Linq.Queryable.Max*), and [`Average`](xref:System.Linq.Queryable.Average*) are not yet supported. +[`LongCount`](xref:System.Linq.Queryable.LongCount*), [`Sum`](xref:System.Linq.Queryable.Sum*), [`Min`](xref:System.Linq.Queryable.Min*), [`Max`](xref:System.Linq.Queryable.Max*), and [`Average`](xref:System.Linq.Queryable.Average*) are not yet supported. [`Count`](xref:System.Linq.Queryable.Count*) takes an optional predicate. To see the supported operations for predicates in Realm queries, refer to the [Predicate Operations](#predicate-operations) section. @@ -79,7 +79,7 @@ class Person : RealmObject } ``` -Given this class, you can create queries with conditions that apply to the `FirstName` and `LastName` properties but not to the `FullName` property. Likewise, properties with the [`[Ignored]`](xref:Realms.IgnoredAttribute) attribute cannot be used. +Given this class, you can create queries with conditions that apply to the `FirstName` and `LastName` properties but not to the `FullName` property. Likewise, properties with the [`[Ignored]`](xref:Realms.IgnoredAttribute) attribute cannot be used. Note that currently, the property must be the left side of a condition. This means that @@ -92,7 +92,7 @@ is illegal and would have to be changed into the equivalent ```csharp var oldDogs = realm.All().Where(dog => dog.Age > 7); // Fixed ``` - + ## Relational Operators Equality operators can be applied to all property types: [==](https://msdn.microsoft.com/en-us/library/53k8ybth.aspx), [!=](https://msdn.microsoft.com/en-us/library/3tz250sf.aspx) @@ -100,7 +100,7 @@ Furthermore, the following can be used for numerical types: [<](https://msdn.mic ## String Operators With strings, you can use: -[`Contains`](xref:System.String.Contains*), [`StartsWith`](xref:System.String.StartsWith*), and [`EndsWith`](xref:System.String.EndsWith*), [`Equals`](xref:System.String.Equals*), and [`Like`](xref:Realms.StringExtensions.Like*). +[`Contains`](xref:System.String.Contains*), [`StartsWith`](xref:System.String.StartsWith*), and [`EndsWith`](xref:System.String.EndsWith*), [`Equals`](xref:System.String.Equals*), and [`Like`](xref:Realms.QueryMethods.Like*). Example: @@ -108,15 +108,15 @@ Example: var peopleWhoseNameBeginsWithJ = realm.All.Where(p => p.FirstName.StartsWith("J")); ``` -By default, Realm will perform a case-sensitive comparison, but you can provide [`StringComparison.OrdinalIgnoreCase`](xref:System.StringComparison.OrdinalIgnoreCase) argument to overwrite that. Since there is no overload for `Contains` that accepts `StringComparison`, we've provided a convenience [extension method](xref:Realms.StringExtensions.Contains*) that can be used when querying: +By default, Realm will perform a case-sensitive comparison, but you can provide [`StringComparison.OrdinalIgnoreCase`](xref:System.StringComparison.OrdinalIgnoreCase) argument to overwrite that. Since there is no overload for `Contains` that accepts `StringComparison` on older .NET frameworks, we've provided a [helper method](xref:Realms.QueryMethods.Contains*) that can be used when querying: ```csharp -var peopleWhoseNameContainsA = realm.All().Where(p => p.FirstName.Contains("a", StringComparison.OrdinalIgnoreCase)); +var peopleWhoseNameContainsA = realm.All().Where(p => QueryMethods.Contains(p.FirstName, "a", StringComparison.OrdinalIgnoreCase)); ``` -The [`Like`](xref:Realms.StringExtensions.Like*) extension method can be used to compare a string property against a pattern. `?` and `*` are allowed as wildcard characters, where `?` matches 1 character and `*` matches 0 or more characters: +The [`Like`](xref:Realms.QueryMethods.Like*) query method can be used to compare a string property against a pattern. `?` and `*` are allowed as wildcard characters, where `?` matches 1 character and `*` matches 0 or more characters: ```csharp -var words = realm.All().Where(p => p.Value.Like("?bc*")); +var words = realm.All().Where(p => QueryMethods.Like(p.Value, "?bc*")); // Matches abc, cbcde, but not bcd ``` @@ -134,10 +134,10 @@ var PuppyRexes = realm.All().Where(dog => dog.Age < 2 && dog.Name == "Rex") ## A note on liveness -Realm queries are *live*, in the sense that they will continue to represent the current state of the database. +Realm queries are *live*, in the sense that they will continue to represent the current state of the database. ```csharp -realm.Write(() => +realm.Write(() => { realm.Add(new Person { FirstName = "John" }); realm.Add(new Person { FirstName = "Peter" }); @@ -167,7 +167,7 @@ However, it also differs from the behavior of LINQ to Objects, where every itera ```csharp var recentLogEntries = realm.All().Where(l => l.TimeStamp > DateTime.Now.AddHours(-1)); -``` +``` Here, the `recentLogEntries` variable will contain all the log entries that have a `TimeStamp` later than one hour before the time when the query was first run (via [foreach](https://msdn.microsoft.com/en-us/library/ttw7t8t6.aspx), [`ToList`](xref:System.Linq.Enumerable.ToList``1(System.Collections.Generic.IEnumerable{``0})) etc.). Newly added log entries will be included on subsequent runs, but the time they are compared to will not be updated. @@ -178,10 +178,10 @@ The following features are not yet supported. A few of them will not be supporte ### Grouping Operators [`GroupBy`](xref:System.Linq.Queryable.GroupBy*) is not supported. -### Set Operators +### Set Operators [`Distinct`](xref:System.Linq.Queryable.Distinct*), [`Union`](xref:System.Linq.Queryable.Union*), [`Intersect`](xref:System.Linq.Queryable.Intersect*), and [`Except`](xref:System.Linq.Queryable.Except*) are not supported. -### Partitioning Operators +### Partitioning Operators [`Take`](xref:System.Linq.Queryable.Take*), [`Skip`](xref:System.Linq.Queryable.Skip*), [`TakeWhile`](xref:System.Linq.Queryable.TakeWhile*), and [`SkipWhile`](xref:System.Linq.Queryable.SkipWhile*) are not yet supported. These are less important than when using an ORM. Given Realm's zero-copy pattern, data is only read from the database when the properties on the objects are accessed, so there is little overhead in simply iterating over a part of a result. @@ -197,10 +197,10 @@ var oldDogs = from d in realm.All() where d.Age > 8 select d; ## Concatenation Operators [`Concat`](xref:System.Linq.Queryable.Concat*) is not supported. -### Join Operators -[`Join`](xref:System.Linq.Queryable.Join*) and [`GroupJoin`](xref:System.Linq.Queryable.GroupJoin*) are not supported. +### Join Operators +[`Join`](xref:System.Linq.Queryable.Join*) and [`GroupJoin`](xref:System.Linq.Queryable.GroupJoin*) are not supported. -Note that joins are less vital when using Realm than when using a relational database and an ORM. Instead of using keys to identify relations, you simply refer to the related object. +Note that joins are less vital when using Realm than when using a relational database and an ORM. Instead of using keys to identify relations, you simply refer to the related object. So given a class diff --git a/Realm.sln.DotSettings b/Realm.sln.DotSettings index 237ab21fe4..de2f45780a 100644 --- a/Realm.sln.DotSettings +++ b/Realm.sln.DotSettings @@ -1,20 +1,69 @@  + True + True + True + True + True True True True + True True + True True True + True + True + True + True + True + True + True + True True + True + True + True True + True + True + True + True True True True + True + True + True + True + True + True + True + True + True + True True True + True + True + True True + True + True + True + True True + True + True + True + True + True + True True + True True + True + True + True True True \ No newline at end of file diff --git a/Realm/AssemblyInfo.props b/Realm/AssemblyInfo.props index e9033fe7f8..fe4b0e6d45 100644 --- a/Realm/AssemblyInfo.props +++ b/Realm/AssemblyInfo.props @@ -1,7 +1,7 @@ Realm .NET - 11.0.0 + 11.1.0 Realm is a mobile database: a replacement for SQLite Realm Inc. Copyright © $([System.DateTime]::Now.ToString(yyyy)) Realm Inc. diff --git a/Realm/Realm.SourceGenerator/Parser.cs b/Realm/Realm.SourceGenerator/Parser.cs index f84588ab6b..cae0b56cd8 100644 --- a/Realm/Realm.SourceGenerator/Parser.cs +++ b/Realm/Realm.SourceGenerator/Parser.cs @@ -18,7 +18,6 @@ using System; using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; using System.Linq; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; diff --git a/Realm/Realm.Unity/package.json b/Realm/Realm.Unity/package.json index f1c45171bb..f327030178 100644 --- a/Realm/Realm.Unity/package.json +++ b/Realm/Realm.Unity/package.json @@ -1,6 +1,6 @@ { "name": "io.realm.unity", - "version": "11.0.0", + "version": "11.1.0", "displayName": "Realm", "description": "Realm is an embedded, object-oriented database that lets you build real-time, always-on applications. With Realm, data is directly exposed as objects and queryable by code, removing the need for ORM's riddled with performance & maintenance issues. Additionally, objects and collections in Realm are always live, meaning that they always reflect the latest data stored in the database. You can subscribe to changes, letting you keep your UI consistently up to date.\nThe .NET Realm SDK also provide access to Atlas App Services, a secure backend that can sync data between devices, authenticate and manage users, and run serverless JavaScript functions.", "unity": "2021.1", diff --git a/Realm/Realm/Configurations/PartitionSyncConfiguration.cs b/Realm/Realm/Configurations/PartitionSyncConfiguration.cs index 14986c0fe7..fd05d217a6 100644 --- a/Realm/Realm/Configurations/PartitionSyncConfiguration.cs +++ b/Realm/Realm/Configurations/PartitionSyncConfiguration.cs @@ -30,7 +30,7 @@ public class PartitionSyncConfiguration : SyncConfigurationBase { /// /// Gets or sets a callback that is invoked when download progress is made when using . - /// This will only be invoked for the initial download of the Realm and will not be invoked as futher download + /// This will only be invoked for the initial download of the Realm and will not be invoked as further download /// progress is made during the lifetime of the Realm. It is ignored when using /// . /// diff --git a/Realm/Realm/Configurations/SyncConfigurationBase.cs b/Realm/Realm/Configurations/SyncConfigurationBase.cs index 2e0b3a287d..f65fb9fefc 100644 --- a/Realm/Realm/Configurations/SyncConfigurationBase.cs +++ b/Realm/Realm/Configurations/SyncConfigurationBase.cs @@ -29,7 +29,7 @@ namespace Realms.Sync /// /// A is used to setup a that can be synchronized between devices using Atlas Device Sync. /// There are two synchronization modes with their respective configurations - "partition" sync with allows you - /// to split your data in separarate partitions and synchronize an entire partition with an entire Realm; "flexible" sync with + /// to split your data in separate partitions and synchronize an entire partition with an entire Realm; "flexible" sync with /// allows you to start with an empty Realm and send the server a set of queries which it will run and /// populate the Realm with all documents matching them. /// @@ -88,7 +88,7 @@ public virtual ClientResetHandlerBase ClientResetHandler /// /// /// If set to false, non-fatal session errors will be ignored and sync will continue retrying the - /// connection under in the background. This means that in cases where the devie is offline, these operations + /// connection under in the background. This means that in cases where the device is offline, these operations /// may take an indeterminate time to complete. /// /// true to throw an error if a non-fatal session error occurs, false otherwise. diff --git a/Realm/Realm/DatabaseTypes/Accessors/UnmanagedAccessor.cs b/Realm/Realm/DatabaseTypes/Accessors/UnmanagedAccessor.cs index 08514d08da..4022e94cd4 100644 --- a/Realm/Realm/DatabaseTypes/Accessors/UnmanagedAccessor.cs +++ b/Realm/Realm/DatabaseTypes/Accessors/UnmanagedAccessor.cs @@ -64,7 +64,7 @@ public abstract class UnmanagedAccessor : IRealmAccessor /// /// Initializes a new instance of the class. /// - /// The runtype type of the realm object. + /// The runtime type of the realm object. public UnmanagedAccessor(Type objectType) { _objectType = objectType; diff --git a/Realm/Realm/DatabaseTypes/Geospatial/GeoBox.cs b/Realm/Realm/DatabaseTypes/Geospatial/GeoBox.cs index 01df2040ef..553f0d94d8 100644 --- a/Realm/Realm/DatabaseTypes/Geospatial/GeoBox.cs +++ b/Realm/Realm/DatabaseTypes/Geospatial/GeoBox.cs @@ -79,7 +79,10 @@ public GeoBox(double left, double top, double right, double bottom) internal NativeGeoBox ToNative() => new(Left, Top, Right, Bottom); - /// + /// + /// Returns a string representation of the value. + /// + /// A string representation of the value. public override string ToString() => $"Box: {{ left: {Left}, top: {Top}, right: {Right}, bottom: {Bottom} }}"; } } diff --git a/Realm/Realm/DatabaseTypes/Geospatial/GeoCircle.cs b/Realm/Realm/DatabaseTypes/Geospatial/GeoCircle.cs index b7f8c56b89..6057fe07fc 100644 --- a/Realm/Realm/DatabaseTypes/Geospatial/GeoCircle.cs +++ b/Realm/Realm/DatabaseTypes/Geospatial/GeoCircle.cs @@ -64,7 +64,10 @@ public GeoCircle(GeoPoint center, Distance radius) internal NativeGeoCircle ToNative() => new(Center.ToNative(), Radius); - /// + /// + /// Returns a string representation of the value. + /// + /// A string representation of the value. public override string ToString() => $"Circle: {{ center: {Center}, radius: {Radius} }}"; } } diff --git a/Realm/Realm/DatabaseTypes/Geospatial/GeoPoint.cs b/Realm/Realm/DatabaseTypes/Geospatial/GeoPoint.cs index dac82e6fc0..7d9d133cdd 100644 --- a/Realm/Realm/DatabaseTypes/Geospatial/GeoPoint.cs +++ b/Realm/Realm/DatabaseTypes/Geospatial/GeoPoint.cs @@ -37,7 +37,7 @@ namespace Realms /// /// Gets the latitude of the point. /// - /// The point's latutide. + /// The point's latitude. public double Latitude { get; } /// @@ -62,7 +62,10 @@ public GeoPoint(double latitude, double longitude) internal NativeGeoPoint ToNative() => new(Latitude, Longitude); - /// + /// + /// Returns a string representation of the value. + /// + /// A string representation of the value. public override string ToString() => $"[{Latitude}, {Longitude}]"; /// @@ -76,7 +79,15 @@ public override bool Equals([NotNullWhen(true)] object? obj) return false; } - /// + /// + /// Indicates whether the current is equal to another + /// . + /// An object to compare with this . + /// + /// if the current point's latitude and longitude are + /// equal to the point's latitude and longitude; + /// otherwise, . + /// public bool Equals(GeoPoint other) { return Latitude == other.Latitude && Longitude == other.Longitude; @@ -91,10 +102,34 @@ public override int GetHashCode() return hashCode; } + /// + /// Compares two instances for equality. + /// + /// The first . + /// The second . + /// + /// true if both points contain the same latitude and longitude; false otherwise. + /// public static bool operator ==(GeoPoint left, GeoPoint right) => left.Equals(right); + /// + /// Compares two instances for inequality. + /// + /// The first . + /// The second . + /// + /// true if the points contain different latitude and longitude; false otherwise. + /// public static bool operator !=(GeoPoint left, GeoPoint right) => !(left == right); + /// + /// Converts a tuple containing latitude and longitude to . + /// + /// The tuple consisting of two coordinates. + /// + /// A with latitude equal to the first element of the tuple and longitude equal + /// to the second element. + /// public static implicit operator GeoPoint((double Latitude, double Longitude) tuple) => new(tuple.Latitude, tuple.Longitude); } } diff --git a/Realm/Realm/DatabaseTypes/Geospatial/GeoPolygon.cs b/Realm/Realm/DatabaseTypes/Geospatial/GeoPolygon.cs index 8516713a41..6e09f617a8 100644 --- a/Realm/Realm/DatabaseTypes/Geospatial/GeoPolygon.cs +++ b/Realm/Realm/DatabaseTypes/Geospatial/GeoPolygon.cs @@ -150,9 +150,12 @@ internal unsafe (NativeGeoPolygon NativePolygon, RealmValue.HandlesToCleanup? Ha return (NativeQueryArgument.GeoPolygon(polygon), handles); } - /// + /// + /// Returns a string representation of the value. + /// + /// A string representation of the value. public override string ToString() => $"Polygon: {LinearRingToString(OuterRing)}" - + (Holes.Count == 0 ? string.Empty : $", Holes: [ {string.Join(", ", Holes.Select(LinearRingToString))} ]"); + + (Holes.Count == 0 ? string.Empty : $", Holes: [ {string.Join(", ", Holes.Select(LinearRingToString))} ]"); internal static string LinearRingToString(IEnumerable points) => $"{{ {string.Join(",", points)} }}"; } diff --git a/Realm/Realm/DatabaseTypes/QueryArgument.cs b/Realm/Realm/DatabaseTypes/QueryArgument.cs index c14fa21e39..f1532ce24d 100644 --- a/Realm/Realm/DatabaseTypes/QueryArgument.cs +++ b/Realm/Realm/DatabaseTypes/QueryArgument.cs @@ -337,7 +337,10 @@ private QueryArgument(RealmValue? realmValue = null, GeoShapeBase? geoValue = nu }; } - /// + /// + /// Returns a string representation of the value. + /// + /// A string representation of the value. public override string ToString() => RealmValue?.ToString() ?? GeoValue?.ToString() ?? "Invalid QueryArgument"; } } diff --git a/Realm/Realm/DatabaseTypes/QueryArgument.tt b/Realm/Realm/DatabaseTypes/QueryArgument.tt index 2e2d4812c6..f410bf3e22 100644 --- a/Realm/Realm/DatabaseTypes/QueryArgument.tt +++ b/Realm/Realm/DatabaseTypes/QueryArgument.tt @@ -103,7 +103,10 @@ namespace Realms }; } - /// + /// + /// Returns a string representation of the value. + /// + /// A string representation of the value. public override string ToString() => RealmValue?.ToString() ?? GeoValue?.ToString() ?? "Invalid QueryArgument"; } } diff --git a/Realm/Realm/DatabaseTypes/RealmCollectionBase.cs b/Realm/Realm/DatabaseTypes/RealmCollectionBase.cs index 99d53026a1..7df01bfad4 100644 --- a/Realm/Realm/DatabaseTypes/RealmCollectionBase.cs +++ b/Realm/Realm/DatabaseTypes/RealmCollectionBase.cs @@ -595,7 +595,7 @@ internal interface IRealmCollectionBase : IMetadataObject THandle NativeHandle { get; } } - [SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:File may only contain a single type", Justification = "NotificationCallbacks are tighly coupled with the collection and it's easier to reason about when they're in the same file.")] + [SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:File may only contain a single type", Justification = "NotificationCallbacks are tightly coupled with the collection and it's easier to reason about when they're in the same file.")] internal class NotificationCallbacks { private readonly RealmCollectionBase _parent; diff --git a/Realm/Realm/DatabaseTypes/RealmInteger.cs b/Realm/Realm/DatabaseTypes/RealmInteger.cs index 48573923f3..954defdc4e 100644 --- a/Realm/Realm/DatabaseTypes/RealmInteger.cs +++ b/Realm/Realm/DatabaseTypes/RealmInteger.cs @@ -333,7 +333,7 @@ public override bool Equals(object? obj) public static implicit operator T(RealmInteger i) => i._value; /// - /// Construts a from its underlying value. + /// Constructs a from its underlying value. /// /// The value. public static implicit operator RealmInteger(T i) => new(i); diff --git a/Realm/Realm/Exceptions/Sync/SubscriptionException.cs b/Realm/Realm/Exceptions/Sync/SubscriptionException.cs index d495da198a..b479d507e4 100644 --- a/Realm/Realm/Exceptions/Sync/SubscriptionException.cs +++ b/Realm/Realm/Exceptions/Sync/SubscriptionException.cs @@ -17,9 +17,8 @@ //////////////////////////////////////////////////////////////////////////// using System; -using Realms.Sync; -namespace Realms.Exceptions.Sync +namespace Realms.Sync.Exceptions { /// /// An exception that describes an issue with a Flexible Sync . diff --git a/Realm/Realm/Handles/RealmHandle.cs b/Realm/Realm/Handles/RealmHandle.cs index a955e2f2db..6e2a3de6b6 100644 --- a/Realm/Realm/Handles/RealmHandle.cs +++ b/Realm/Realm/Handles/RealmHandle.cs @@ -31,13 +31,13 @@ // -read up on notes reg. CriticalHandle, and SafeHandle and potential problems with concurrency that are mitigated by the C# library by // refcounting the SafeHandle on interop calls // I think we can save the performance penalty induced by SafeHandle because we know for sure that we will in fact never (for the same handle) call other than constructors -// concurrenlty - because when we are in a finalizer, the user thread for this handle is definetly dead. (except if several wrappers have been +// concurrently - because when we are in a finalizer, the user thread for this handle is definitely dead. (except if several wrappers have been // taken out for this particular handle - in that case we do in fact risk having several finalizing objects, and several live ones -and seen from the -// user perspective, the live ones are acessed in a serialized way) +// user perspective, the live ones are accessed in a serialized way) // however, in that case (say same table taken out of a shared group 10 times) the last 9 tables are refcounted in core, so them being refcounted down -// should not affect the tenth table being accessed concurrenlty at the same time +// should not affect the tenth table being accessed concurrently at the same time -// according to .net sourcecode we have a guarentee that a CriticalHandle will not get finalized while it is used in an interop call +// according to .net sourcecode we have a guarantee that a CriticalHandle will not get finalized while it is used in an interop call /* * 3) GC.KeepAlive behavior - P/Invoke vs. finalizer thread ---- (HandleRef) @@ -68,17 +68,17 @@ internal abstract class RealmHandle : SafeHandle // if NoMoreUserThread is true, then we know that no more calls into this class will come from user threads. // The boolean is set to true when the root object's dispose or finalizer is called. // The C# binding will block access to core (via IsValid) in case of dispose having been called - // this again menas that instaed of putting handles into the unbindlist we can unbind the handles right away + // this again means that instead of putting handles into the unbindlist we can unbind the handles right away // even though we are called from a finalizer thread // we also use the boolean as the lock object for serializing access to the list - // Unbind is called by criticalhandle to unbind unmanaged/native resuorces + // Unbind is called by criticalhandle to unbind unmanaged/native resources // As we don't want to call core concurrently from a finalizer thread // releasehandle will in fact just move ownership to the root // object of this object. The root object might then call unbind on this object which // will do the actual resource deallocation. // however, as far as this particular object is concerned, it has - // removed its ownership in a controlled, unleaking way by calling root.ReqestUnbind(); + // removed its ownership in a controlled, unleaking way by calling root.RequestUnbind(); // (If criticalhandle and jitter manages to pre-jit the entire call graph correctly, // we are calling an overridden virtual method after all (but so is private Criticalhandle cleanup )) // criticalhandle source here : http://reflector.webtropy.com/default.aspx/Dotnetfx_Win7_3@5@1/Dotnetfx_Win7_3@5@1/3@5@1/DEVDIV/depot/DevDiv/releases/whidbey/NetFXspW7/ndp/clr/src/BCL/System/Runtime/InteropServices/CriticalHandle@cs/1/CriticalHandle@cs @@ -139,7 +139,7 @@ protected override bool ReleaseHandle() { // as a child object we wil ask our root to unbind us (testing nomoreuserthread to determine if it can be done at once or we will just have to be put in an unbindlist) // ask our root to unbind us (if it is itself finalizing) or put us into the unbind list (if it is still running) - // note that the this instance cannot and will never be aroot itself bc root != null + // note that the this instance cannot and will never be a root itself bc root != null Root.RequestUnbind(this); } diff --git a/Realm/Realm/Handles/SubscriptionSetHandle.cs b/Realm/Realm/Handles/SubscriptionSetHandle.cs index 845508e458..5fef2ce465 100644 --- a/Realm/Realm/Handles/SubscriptionSetHandle.cs +++ b/Realm/Realm/Handles/SubscriptionSetHandle.cs @@ -20,8 +20,8 @@ using System.Runtime.InteropServices; using System.Threading.Tasks; using MongoDB.Bson; -using Realms.Exceptions.Sync; using Realms.Native; +using Realms.Sync.Exceptions; namespace Realms.Sync { diff --git a/Realm/Realm/Linq/RealmResultsVisitor.cs b/Realm/Realm/Linq/RealmResultsVisitor.cs index 5af8bd28c7..3f35ba501c 100644 --- a/Realm/Realm/Linq/RealmResultsVisitor.cs +++ b/Realm/Realm/Linq/RealmResultsVisitor.cs @@ -695,7 +695,7 @@ private Expression GetObjectAtIndex(int index, ResultsHandle rh, string methodNa { if (methodName.EndsWith("OrDefault", StringComparison.OrdinalIgnoreCase)) { - // For First/Last/Single/ElemetAtOrDefault - ignore + // For First/Last/Single/ElementAtOrDefault - ignore return Expression.Constant(null); } diff --git a/Realm/Realm/Native/NativeCommon.cs b/Realm/Realm/Native/NativeCommon.cs index fa43ead62d..4ca7471650 100644 --- a/Realm/Realm/Native/NativeCommon.cs +++ b/Realm/Realm/Native/NativeCommon.cs @@ -85,7 +85,7 @@ internal static void Initialize() /// **WARNING**: This will close all native Realm instances and AppHandles. This method is extremely unsafe /// to call in any circumstance where the user might be accessing anything Realm-related. The only places /// where we do call it is in DomainUnload and Application.quitting on Unity. We expect that at this point - /// the Application/Domain is being torn down and the user should not be interracting with Realm. + /// the Application/Domain is being torn down and the user should not be interacting with Realm. /// public static void CleanupNativeResources(string reason) { diff --git a/Realm/Realm/Realm.cs b/Realm/Realm/Realm.cs index d129f0f9c6..4ced533e29 100644 --- a/Realm/Realm/Realm.cs +++ b/Realm/Realm/Realm.cs @@ -55,9 +55,9 @@ public class Realm : IDisposable /// (little-endian for most modern CPUs) while the database query engine and Sync would always treat them as big-endian. This manifests /// as different string representations between the SDK and the database - e.g. "f2952191-a847-41c3-8362-497f92cb7d24" instead of /// "912195f2-47a8-c341-8362-497f92cb7d24" (notice the swapped bytes in the first 3 components). Starting with 10.10.0, big-endian - /// representation is the default one and a seamless one-time migraiton is provided for local (non-sync) Realms. The first time a + /// representation is the default one and a seamless one-time migration is provided for local (non-sync) Realms. The first time a /// Realm is opened, all properties holding a Guid value will be updated from little-endian to big-endian format and the .NET SDK - /// will treat them as such. There should be no noticable change when reading/writing data from the SDK, but you should see consistent + /// will treat them as such. There should be no noticeable change when reading/writing data from the SDK, but you should see consistent /// values when accessing the Realm file from Realm Studio or other SDKs. ///
/// For synchronized Realms, such a migration is impossible due to the distributed nature of the data. Therefore, the assumption @@ -656,8 +656,8 @@ public void Add(T obj) /// If the collection contains items that are already managed by this , they will be ignored. /// This method modifies the objects in-place, meaning that after it has run, all items in the collection will be managed. /// Once an becomes managed and the transaction is committed, - /// dereferencing any property of the original reference throw an exeception. - /// Hence, none of the properties of the elements in the collection can be deferenced anymore after the transaction. + /// dereferencing any property of the original reference throw an exception. + /// Hence, none of the properties of the elements in the collection can be dereferenced anymore after the transaction. /// public void Add(IEnumerable objs) where T : IAsymmetricObject @@ -903,7 +903,7 @@ public async Task BeginWriteAsync(CancellationToken cancellationTok /// /// Optional cancellation token to stop waiting to start a write transaction. /// - /// An awaitable that indicates that the transaction has been committed succesffully. + /// An awaitable that indicates that the transaction has been committed successfully. public Task WriteAsync(Action action, CancellationToken cancellationToken = default) { ThrowIfDisposed(); @@ -940,7 +940,7 @@ public Task WriteAsync(Action action, CancellationToken cancellationToken = defa /// /// The type returned by the input delegate. /// - /// An awaitable that indicates that the transaction has been committed succesffully. The result of + /// An awaitable that indicates that the transaction has been committed successfully. The result of /// the task is the result returned by invoking . /// public async Task WriteAsync(Func function, CancellationToken cancellationToken = default) @@ -1695,7 +1695,7 @@ public IEmbeddedObject InsertEmbeddedObjectInList(object list, int index) /// , , and have to be used instead of /// , , and . /// - /// Setting an object at an index will remove the existing object from the list and unown it. Since unowned embedded objects are automatically deleted, + /// Setting an object at an index will remove the existing object from the list and un-own it. Since unowned embedded objects are automatically deleted, /// the old object that the list contained at will get deleted when the transaction is committed. /// /// diff --git a/Realm/Realm/Sync/ErrorHandling/RecoverOrDiscardUnsyncedChangesHandler.cs b/Realm/Realm/Sync/ErrorHandling/RecoverOrDiscardUnsyncedChangesHandler.cs index af114cab35..7379b53407 100644 --- a/Realm/Realm/Sync/ErrorHandling/RecoverOrDiscardUnsyncedChangesHandler.cs +++ b/Realm/Realm/Sync/ErrorHandling/RecoverOrDiscardUnsyncedChangesHandler.cs @@ -22,11 +22,11 @@ namespace Realms.Sync.ErrorHandling { /// /// A client reset strategy that attempts to automatically recover any unsynchronized changes. - /// If that fails, this handler fallsback to the discard unsynced changes strategy. + /// If that fails, this handler falls back to the discard unsynced changes strategy. /// /// /// The automatic recovery fails when a client that is configured for recovery is flagged on the server "as not allowed to execute automatic recovery". - /// In this situation this strategy fallsback to the discard unsynced one. + /// In this situation this strategy falls back to the discard unsynced one. /// To reiterate what it does: it discards all the unsynced local changes and uses the latest realm that is available on the remote sync server. /// You can read more about the automatic merge rules at Client Resets - .NET SDK. /// The automatic recovery mechanism creates write transactions meaning that all the changes that take place @@ -36,9 +36,9 @@ namespace Realms.Sync.ErrorHandling /// , is invoked just before the client reset happens. /// , is invoke if and only if an automatic client reset succeeded. The callback is never called /// if the automatic client reset fails. - /// is invoked if and only if an automatic client reset failed and instead the discard unsynced one succeded. + /// is invoked if and only if an automatic client reset failed and instead the discard unsynced one succeeded. /// The callback is never called if the discard unsynced client reset fails. - /// is invoked whenever an error occurs in either of the recovery stragegies and the system needs to fallback to a manual mode. + /// is invoked whenever an error occurs in either of the recovery strategies and the system needs to fallback to a manual mode. /// The overall recommendation for using this strategy is that using the three available callbacks should only be considered when: /// 1. The user needs to be notified (in ) of an incoming potential data loss /// of unsynced data as a result of a merge or a complete discard of unsynced local changes diff --git a/Realm/Realm/Sync/FlexibleSync/SubscriptionSet.cs b/Realm/Realm/Sync/FlexibleSync/SubscriptionSet.cs index a967e26b0d..fa121e5c12 100644 --- a/Realm/Realm/Sync/FlexibleSync/SubscriptionSet.cs +++ b/Realm/Realm/Sync/FlexibleSync/SubscriptionSet.cs @@ -22,8 +22,8 @@ using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Threading.Tasks; -using Realms.Exceptions.Sync; using Realms.Helpers; +using Realms.Sync.Exceptions; namespace Realms.Sync { @@ -245,7 +245,7 @@ public int Remove(IQueryable query, bool removeNamed = false) /// /// Removes the provided from this subscription set. /// - /// The subcription to remove. + /// The subscription to remove. /// /// true if the subscription existed in this subscription set and was removed; false otherwise. /// diff --git a/Realm/Realm/Sync/SyncTimeoutOptions.cs b/Realm/Realm/Sync/SyncTimeoutOptions.cs index 0de86cf9b0..0cec1717b7 100644 --- a/Realm/Realm/Sync/SyncTimeoutOptions.cs +++ b/Realm/Realm/Sync/SyncTimeoutOptions.cs @@ -69,7 +69,7 @@ public class SyncTimeoutOptions public TimeSpan PingKeepAlivePeriod { get; set; } = TimeSpan.FromMinutes(1); /// - /// Gets or sets how long to wait for a reponse to a heartbeat ping before + /// Gets or sets how long to wait for a response to a heartbeat ping before /// concluding that the connection has dropped. /// /// diff --git a/Realm/Realm/Sync/User.cs b/Realm/Realm/Sync/User.cs index 58a2e1e663..726b729917 100644 --- a/Realm/Realm/Sync/User.cs +++ b/Realm/Realm/Sync/User.cs @@ -373,7 +373,7 @@ public async Task> FetchAllAsync() /// Enables an API key by id. ///
/// The id of the key to enable. - /// An awaitable representing the asynchrounous enable operation. + /// An awaitable representing the asynchronous enable operation. /// public Task EnableAsync(ObjectId id) => Handle404(_user.Handle.EnableApiKeyAsync(_user.App.Handle, id), id);