sdk/dotnet/src/Microsoft.Datasync.Client/Serialization/DatasyncContractResolver.cs
/// <summary>
/// Returns the ID <see cref="JsonProperty"/> for the given type.
/// </summary>
/// <param name="type">The subject type.</param>
/// <param name="throwIfNotFound">If <c>true</c>, throw an exception if the ID property cannot be found.</param>
/// <returns>The ID <see cref="JsonProperty"/>.</returns>
/// <exception cref="InvalidOperationException">If the ID property is not found and <paramref name="throwIfNotFound"/> is set to <c>true</c>.</exception>
Returns the ID  for the given type.
Returns the ID for the given type .
public virtual JsonProperty ResolveIdProperty(Type type, bool throwIfNotFound = true)
        {
            if (!idPropertyCache.TryGetValue(type, out JsonProperty property))
            {
                ResolveContract(type);
                idPropertyCache.TryGetValue(type, out property);
            }
            if (property == null && throwIfNotFound)
            {
                throw new InvalidOperationException($"No '{SystemProperties.JsonIdProperty}' member found on type '{type.FullName}'.");
            }
            return property;
        }
public virtual JsonProperty ResolveIdProperty ( Type type , bool throwIfNotFound = true ) { if ( ! idPropertyCache . TryGetValue ( type , out JsonProperty property ) ) { ResolveContract ( type ) ; idPropertyCache . TryGetValue ( type , out property ) ; } if ( property == null && throwIfNotFound ) { throw new InvalidOperationException ( $" No ' { SystemProperties . JsonIdProperty } ' member found on type ' { type . FullName } '. " ) ; } return property ; }
Returns the ID  for the given type.
Returns the ID for the given type .
The ID .
The ID .
If the ID property is not found and  is set to true
If the ID property is not found and is set to true
type
Type
The subject type.
The subject type .
throwIfNotFound
bool
None