コード例 #1
0
 /// <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);
     }
 }
コード例 #2
0
 /// <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));
     }
 }
コード例 #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();
 }
コード例 #4
0
 public void ValidatePropertyUniqueness(ODataPropertyInfo property)
 {
     // nop
 }
コード例 #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)));
 }