get set c#
private string name;
public string Name
{
get
{
return this.name;
}
set
{
this.name = value;
}
}
get set c#
private string name;
public string Name
{
get
{
return this.name;
}
set
{
this.name = value;
}
}
can a dictionary type use get set c#
public class YourClass
{
private readonly IDictionary<string, string> _yourDictionary = new Dictionary<string, string>();
public string this[string key]
{
// returns value if exists
get { return _yourDictionary[key]; }
// updates if exists, adds if doesn't exist
set { _yourDictionary[key] = value; }
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us