I\'m getting the following error :
\"Property does not exist in the current context\".
I checked on StackOverflow the usual causes
Problem is your lack of basic understanding of OOP. You're trying to assign the base class property from the class scope which is not the way it works in OOP. You have to create some "callable" scope eg. constructor, and inside of that scope assign your parent's fields/properties:
public class Audi : Voiture {
// Draper() ...
public Audi() : base() {
Marque = "Audi";
}
}
more descriptive answer :
Everything inside a class scope is known as definition and every other scope in it is called an implementation. Since you've defined ( made a definition ) of that field/property in your parent class, you have to assign it in an implementation where access modifiers of that field/property allows you to or in the very same moment you're defining this field/property.