> For the complete documentation index, see [llms.txt](https://cnahmet.gitbook.io/asp-net-notlarim/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cnahmet.gitbook.io/asp-net-notlarim/nesne-tabanli-programlama/properties.md).

# Properties

Bir class içerinde değişken olarak tanımlanan bilgilere property denir.

```
class Product{
        public string Name;
        private double Price;

        public void SetPrice(double price){
            if(price<0){
                this.Price=0;
            }else{
                this.Price=price;
            }
        }

        public double GetPrice(){
            return this.Price;
        }
    }

    class Program
    {

        static void Main(string[] args)
        {
            var urun = new Product();
            urun.Name="Apple";
            urun.SetPrice(14000);
            System.Console.WriteLine($"{urun.Name} - {urun.GetPrice()}");

            Console.WriteLine();

            urun.Name="Samsung";
            urun.SetPrice(-15000);
            System.Console.WriteLine($"{urun.Name} - {urun.GetPrice()}");
        }
    }

```
