Answers for "get and set for array c#"

C#
0

get and set for array c#

// Automatically
public class Customer
{
    public string CustomerName { get; set; }

    public double[] TotalPurchasesLastThreeDays { get; set; }
}

// ----------------------- OR ---------------------------
// Manually
public class Customer
    {
        private double[] totalPurchasesLastThreeDays; 

        public string CustomerName { get; set; }

        public double[] TotalPurchasesLastThreeDays
        {
            get
            {
                return totalPurchasesLastThreeDays;
            }
            set
            {
                totalPurchasesLastThreeDays = value;
            }
        }
    }
Posted by: Guest on June-18-2020

C# Answers by Framework

Browse Popular Code Answers by Language