Dev2.Runtime.ServiceModel.Data.DbService.ToXml C# (CSharp) Method

ToXml() public method

public ToXml ( ) : System.Xml.Linq.XElement
return System.Xml.Linq.XElement
        public override XElement ToXml()
        {
            var actionName = Recordset == null || Recordset.Name == null ? string.Empty : Recordset.Name;
            var result = CreateXml(enActionType.InvokeStoredProc, actionName, Source, new RecordsetList { Recordset });
            return result;
        }

Usage Example

        // ReSharper disable InconsistentNaming
        public void DbService_ToXml_CorrectXml()
        // ReSharper restore InconsistentNaming
        {
            // ReSharper disable InconsistentNaming
            const string xmlDataString = @"<Service ID=""af8d2d38-22b5-4599-8357-adce196beb83"" Name=""TravsTestService"" ResourceType=""DbService"" IsValid=""true"">
  <Actions>
    <Action Name=""dbo.InsertDummyUser"" Type=""InvokeStoredProc"" SourceID=""ebba47dc-e5d4-4303-a203-09e2e9761d16"" SourceName=""testingDBSrc"" ExecuteAction=""dbo.InsertDummyUser"" SourceMethod=""dbo.InsertDummyUser"">
      <Inputs>
        <Input Name=""fname"" Source=""fname"" EmptyToNull=""false"" DefaultValue="""" NativeType=""System.Object"" />
        <Input Name=""lname"" Source=""lname"" EmptyToNull=""false"" DefaultValue="""" NativeType=""System.Object"" />
        <Input Name=""username"" Source=""username"" EmptyToNull=""false"" DefaultValue="""" NativeType=""System.Object"" />
        <Input Name=""password"" Source=""password"" EmptyToNull=""false"" DefaultValue="""" NativeType=""System.Object"" />
        <Input Name=""lastAccessDate"" Source=""lastAccessDate"" EmptyToNull=""false"" DefaultValue="""" NativeType=""System.Object"" />
      </Inputs>
      <Outputs />
      <OutputDescription><![CDATA[<z:anyType xmlns:i=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:d1p1=""http://schemas.datacontract.org/2004/07/Unlimited.Framework.Converters.Graph.Ouput"" i:type=""d1p1:OutputDescription"" xmlns:z=""http://schemas.microsoft.com/2003/10/Serialization/""><d1p1:DataSourceShapes xmlns:d2p1=""http://schemas.microsoft.com/2003/10/Serialization/Arrays""><d2p1:anyType i:type=""d1p1:DataSourceShape""><d1p1:_x003C_Paths_x003E_k__BackingField /></d2p1:anyType></d1p1:DataSourceShapes><d1p1:Format>ShapedXML</d1p1:Format></z:anyType>]]></OutputDescription>
    </Action>
  </Actions>
  <AuthorRoles />
  <Comment />
  <Tags />
  <HelpLink />
  <UnitTestTargetWorkflowService />
  <BizRule />
  <WorkflowActivityDef />
  <XamlDefinition />
  <DataList />
  <TypeOf>InvokeStoredProc</TypeOf>
  <DisplayName>TravsTestService</DisplayName>
  <Category>WEBPART_WIZARDS</Category>
  <AuthorRoles></AuthorRoles>
  <ErrorMessages />
</Service>";
            // ReSharper restore InconsistentNaming
            XElement testElm = XElement.Parse(xmlDataString);
            DbService dbService = new DbService(testElm);
            XElement returnedXelm = dbService.ToXml();
            string actual = returnedXelm.ToString();

            Assert.AreEqual(xmlDataString, actual);
        }
All Usage Examples Of Dev2.Runtime.ServiceModel.Data.DbService::ToXml