using System;
using JsonSrcGen;
/*
namespace ConsoleApp1
{
*/
[Json]
public class MyType
{
[JsonName("my_name")]
public string MyProperty { get; set; }
[JsonIgnore]
public string IgnoredProperty { get; set; }
}
// }
with above code, lots of compilation error occurred like these,
Error CS0501 '<invalid-global-code>.<invalid-global-code>(value, builder)' must declare a body because it is not marked abstract, extern, or partial
Error CS0501 'JsonConverter.ToJson(global)' must declare a body because it is not marked abstract, extern, or partial
Error CS0116 A namespace cannot directly contain members such as fields or methods
Error CS1520 Method must have a return type
...[omitted for brevity]...
For example,
with above code, lots of compilation error occurred like these,