Пример #1
0
 public void EnableWcfDataServicesClientBehavior(Func <ODataEntry, XmlWriter, XmlWriter> startEntryXmlCustomizationCallback, Action <ODataEntry, XmlWriter, XmlWriter> endEntryXmlCustomizationCallback, string odataNamespace, string typeScheme)
 {
     ExceptionUtils.CheckArgumentNotNull <string>(odataNamespace, "odataNamespace");
     ExceptionUtils.CheckArgumentNotNull <string>(typeScheme, "typeScheme");
     if (((startEntryXmlCustomizationCallback == null) && (endEntryXmlCustomizationCallback != null)) || ((startEntryXmlCustomizationCallback != null) && (endEntryXmlCustomizationCallback == null)))
     {
         throw new ODataException(Strings.ODataMessageWriterSettings_MessageWriterSettingsXmlCustomizationCallbacksMustBeSpecifiedBoth);
     }
     this.writerBehavior = ODataWriterBehavior.CreateWcfDataServicesClientBehavior(startEntryXmlCustomizationCallback, endEntryXmlCustomizationCallback, odataNamespace, typeScheme);
 }
Пример #2
0
        public void EnableWcfDataServicesClientBehavior(
            Func <ODataEntry, XmlWriter, XmlWriter> startEntryXmlCustomizationCallback,
            Action <ODataEntry, XmlWriter, XmlWriter> endEntryXmlCustomizationCallback,
            string odataNamespace,
            string typeScheme)
        {
            ExceptionUtils.CheckArgumentNotNull(odataNamespace, "odataNamespace");
            ExceptionUtils.CheckArgumentNotNull(typeScheme, "typeScheme");

            this.SetAtomEntryXmlCustomization(startEntryXmlCustomizationCallback, endEntryXmlCustomizationCallback);

            this.writerBehavior = ODataWriterBehavior.CreateWcfDataServicesClientBehavior(
                odataNamespace,
                typeScheme);
        }