C
C#10mo ago
Zomboos

❔ getproperties reset object properties to 0

9 Replies
Azrael
Azrael10mo ago
What?
Zomboos
Zomboos10mo ago
so in visual studio i kept track of all the properties and they all exist untill the getproperties where they suddenly dissapear
Anu6is
Anu6is10mo ago
you vehicle class uses fields not properties
Zomboos
Zomboos10mo ago
ow haha thats probally where it went wrong how can i change my fields into properties then
ransomink
ransomink10mo ago
i'd look at a tutorial on how to create properties in c#. it's a beginner topic you should learn about . . .
Angius
Angius10mo ago
$structure
MODiX
MODiX10mo ago
namespace Namespace;

[Attribute]
public class Class
{
public string PublicField;
private bool _privateField;
protected double protectedField;

public int PublicProperty { get; set; }

public Class() {} // Constructor

public void Method(int parameter)
{
var localVariable = parameter;
}
}
namespace Namespace;

[Attribute]
public class Class
{
public string PublicField;
private bool _privateField;
protected double protectedField;

public int PublicProperty { get; set; }

public Class() {} // Constructor

public void Method(int parameter)
{
var localVariable = parameter;
}
}
For C# versions older than 10, see $StructureOld
Zomboos
Zomboos10mo ago
Alright thank you all, il look into them
Accord
Accord10mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server
More Posts