csharp-class

Without specifying public the class is implicitly internal. This means that the class is only visible inside the same assembly. When you specify public, the class is visible outside the assembly.

It is also allowed to specify the internal modifier explicitly:

internal class Foo {}

to string

Log.Information(JsonConvert.SerializeObject(item));

copy

msdn

public class IdInfo
{
public int IdNumber;

public IdInfo(int IdNumber)
{
this.IdNumber = IdNumber;
}
}
public class Person
{
public int Age;
public string Name;
public IdInfo IdInfo;

public Person ShallowCopy()
{
return (Person) this.MemberwiseClone();
}

public Person DeepCopy()
{
Person other = (Person) this.MemberwiseClone();
other.IdInfo = new IdInfo(IdInfo.IdNumber);
other.Name = String.Copy(Name);
return other;
}
}

// Create an instance of Person and assign values to its fields.
Person p1 = new Person();
p1.Age = 42;
p1.Name = "Sam";
p1.IdInfo = new IdInfo(6565);

// Perform a shallow copy of p1 and assign it to p2.
Person p2 = p1.ShallowCopy();