/// <summary>
 /// Validates an <see cref="ODataProperty"/> for not being null.
 /// </summary>
 /// <param name="property">The property to validate for not being null.</param>
 internal static void ValidatePropertyNotNull(ODataPropertyInfo property)
 {
     if (property == null)
     {
         throw new ODataException(Strings.WriterValidationUtils_PropertyMustNotBeNull);
     }
 }
 /// <summary>
 /// Validates property uniqueness.
 /// </summary>
 /// <param name="property">The property.</param>
 public void ValidatePropertyUniqueness(ODataPropertyInfo property)
 {
     try
     {
         propertyState.Add(property.Name, State.NonNestedResource);
     }
     catch (ArgumentException)
     {
         throw new ODataException(
                   Strings.DuplicatePropertyNamesNotAllowed(
                       property.Name));
     }
 }
Ejemplo n.º 3
0
 /// <summary>Writes a primitive property within a resource.</summary>
 /// <param name="primitiveProperty">The primitive property to write.</param>
 public virtual void WriteStart(ODataPropertyInfo primitiveProperty)
 {
     throw new NotImplementedException();
 }
 public void ValidatePropertyUniqueness(ODataPropertyInfo property)
 {
     // nop
 }
Ejemplo n.º 5
0
 /// <summary> Asynchronously write a primitive property within a resource. </summary>
 /// <returns>A task instance that represents the asynchronous write operation.</returns>
 /// <param name="primitiveProperty">The primitive property to write.</param>
 public virtual Task WriteStartAsync(ODataPropertyInfo primitiveProperty)
 {
     return(TaskUtils.GetTaskForSynchronousOperation(() => this.WriteStart(primitiveProperty)));
 }