21
1
using System;
2
3
public class Program
4
{
5
public static void Main()
6
{
7
8
//create class instance
9
Program p= new Program();
10
//call method using class instance created above
11
p.AddTwoNumber();
12
}
13
//void is return type, means it will not return anything
14
//public is acces type, means it can be accessed from anywhere in the program
15
public void AddTwoNumber()
16
{
17
int a=10, b=20;
18
int c= a+b;
19
Console.WriteLine("Sum ="+c);
20
}
21
}
Cached Result
Roslyn 2.0 Compiler; Environment version: 4.0.30319.42000
Input XML:
<ns0:transmission xmlns:ns0="blabla.xsd">
<ns0:DiagnosisErrorResponse>
<ns0:ID>7</ns0:ID>
<ns0:ErrorCode>9</ns0:ErrorCode>
<ns0:ErrorDescription>sometext</ns0:ErrorDescription>
<ns0:ErrorDate>11-12-2018</ns0:ErrorDate>
</ns0:DiagnosisErrorResponse>
</ns0:transmission>
Deserialied and re-serialized DiagnosisErrorResponse
<?xml version="1.0" encoding="utf-16"?>
<DiagnosisErrorResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="blabla.xsd">
<ID>7</ID>
<ErrorCode>9</ErrorCode>
<ErrorDescription>sometext</ErrorDescription>
<ErrorDate>11-12-2018</ErrorDate>
</DiagnosisErrorResponse>
Input XML:
<ns0:transmission xmlns:ns0="blabla.xsd">
<ns0:DiagnosisErrorResponse>
<ns0:ID>7</ns0:ID>
<ns0:ErrorCode>9</ns0:ErrorCode>
<ns0:ErrorDescription>sometext</ns0:ErrorDescription>
<ns0:ErrorDate>11-12-2018</ns0:ErrorDate>
</ns0:DiagnosisErrorResponse>
</ns0:transmission>
Deserialied and re-serialized DiagnosisErrorResponse
<?xml version="1.0" encoding="utf-16"?>
<DiagnosisErrorResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="blabla.xsd">
<ID>7</ID>
<ErrorCode>9</ErrorCode>
<ErrorDescription>sometext</ErrorDescription>
<ErrorDate>11-12-2018</ErrorDate>
</DiagnosisErrorResponse>