From 30448c8673f76cb256a9f3fb321af6227b41bb11 Mon Sep 17 00:00:00 2001 From: Hakan Kutluay Date: Wed, 26 Oct 2022 17:42:54 +0300 Subject: [PATCH] update readme and version info (#68) * update readme * update version * update test project dependencies --- README.md | 43 +++++++++++++++++++++++++++++++++- Ubl-Tr/UblTr.csproj | 6 ++--- UblTr.Tests/UblTr.Tests.csproj | 8 +++---- 3 files changed, 49 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 9db28c2..59a35fc 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,47 @@ PM> Install-Package UblTr ## InvoiceType Usage ### Serialize + +Using implict operators to assign values +```csharp +private static void Main(string[] args) +{ + var invoice = new UblTr.MainDoc.InvoiceType() + { + UUID = Guid.NewGuid().ToString(), + UBLVersionID ="2.1", + CustomizationID = "TR1.2", + ProfileID ="TEMELFATURA", + ID = "INV20200000000001", + CopyIndicator = false + }; + + XmlSerializer xmlSerializer = new XmlSerializer(typeof(UblTr.MainDoc.InvoiceType)); + using TextWriter writer = new StreamWriter(@"./TestInvoice.xml"); //path to document + xmlSerializer.Serialize(writer, invoice, new UblTr.Serialization.UblTrNamespaces()); +} +``` + +Or using explicilty assign values +```csharp +private static void Main(string[] args) +{ + var invoice = new UblTr.MainDoc.InvoiceType() + { + UUID = new UblTr.Common.UUIDType() { Value = Guid.NewGuid().ToString() }, + UBLVersionID = new UblTr.Common.UBLVersionIDType() { Value = "2.1" }, + CustomizationID = new UblTr.Common.CustomizationIDType() { Value = "TR1.2" }, + ProfileID = new UblTr.Common.ProfileIDType() { Value = "TEMELFATURA" }, + ID = new UblTr.Common.IDType() { Value = "INV20200000000001" }, + CopyIndicator = new UblTr.Common.CopyIndicatorType() { Value = false } + }; + + XmlSerializer xmlSerializer = new XmlSerializer(typeof(UblTr.MainDoc.InvoiceType)); + using TextWriter writer = new StreamWriter(@"./TestInvoice.xml"); //path to document + xmlSerializer.Serialize(writer, invoice, new UblTr.Serialization.UblTrNamespaces()); +} + +``` ```csharp private static void Main(string[] args) { @@ -90,7 +131,7 @@ private static void Main(string[] args) }; XmlSerializer xmlSerializer = new XmlSerializer(typeof(UblTr.MainDoc.DespatchAdviceType)); - using TextWriter writer = new StreamWriter(@"C:\Temp\TestDespatch.xml"); //path to document + using TextWriter writer = new StreamWriter(@"./TestDespatch.xml"); //path to document xmlSerializer.Serialize(writer, invoice, new UblTr.Serialization.UblTrNamespaces()); } diff --git a/Ubl-Tr/UblTr.csproj b/Ubl-Tr/UblTr.csproj index 746393e..8143940 100644 --- a/Ubl-Tr/UblTr.csproj +++ b/Ubl-Tr/UblTr.csproj @@ -9,10 +9,10 @@ Github ubltr ubl-tr e-invoice ubl ubl-tr-1.2.1 e-fatura fatura efatura e-despatch eirsaliye irsaliye applicationresponse uygulamayaniti creditnote receiptadvice MIT - 1.2.0 + 1.3.0 icon.png - 1.2.0.0 - 1.2.0.0 + 1.3.0.0 + 1.3.0.0 diff --git a/UblTr.Tests/UblTr.Tests.csproj b/UblTr.Tests/UblTr.Tests.csproj index 34975c3..b169062 100644 --- a/UblTr.Tests/UblTr.Tests.csproj +++ b/UblTr.Tests/UblTr.Tests.csproj @@ -8,10 +8,10 @@ - - - - runtime; build; native; contentfiles; analyzers; buildtransitive + + + + runtime; build; native; contentfiles; analyzers; buildtransitive all