Struct strikes back

public class TestClass
{
public StructField StructField { get; set; }
}

public struct StructField
{
public string PropertyString { get; set; }
public int PropertyInt { get; set; }
}

public static class SomeClass
{
public static unsafe void TestMethod()
{
TestClass test = new();

test.StructField.PropertyString = "";
test.StructField.PropertyInt = 0;

test.StructField = default;
}
}
test.StructField.PropertyString = "";
test.StructField.PropertyInt = 0;

Reference

--

--

--

Software developer since 2006. Web (mostly backend) development now. My stack — .NET (APS.NET Core MVC) Working in Rosatom.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Jollychic customer Care number/858489273O/Jollychic customer Care number/858489273O/Jollychic…

Voyage Across the Cloud with Kubernetes

Coupling and Cohesion

Tier1 Carrier and Mobile Operator Receivable Funding; Enreach Product

Obtain Lithium Prices In C Language with An API

How did I build basic reports 📈 of the US Stock Market big data using Python?

I called the Medical School to find out my status on the waiting list. The woman on

How to change frame rate of video on Mac

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Guriy Samarin

Guriy Samarin

Software developer since 2006. Web (mostly backend) development now. My stack — .NET (APS.NET Core MVC) Working in Rosatom.

More from Medium

MVC Pattern in C Sharp

MVC Pattern in C Sharp

Explore Shadow Properties in EF Core

Fixing my BF1942 woes with Win32 APIs

SOLID Principles