Demo entry 5017973

teste

   

Submitted by anonymous on May 30, 2016 at 21:56
Language: C#. Code size: 981 Bytes.

using System;

namespace MyExampleNamespace
{
    public class Customer : IDisposable
    {
        private string _customerName;
        private DateTime _lastUpdated;

        public string CustomerName
        {
            get
            {
                return _customerName;
            }
            set
            {
                _customerName = value;
                _lastUpdated = DateTime.Now;
            }
        }

        public DateTime LastUpdated
        {
            get
            {
                return _lastUpdated;
            }
            private set
            {
                _lastUpdated = value;
            }
        }

        public void UpdateCustomer(string newName)
        {
            if (!newName.Equals(CustomerName))
            {
                CustomerName = newName;
            }
        }

        public void Dispose()
        {
            // Do nothing
        }
    }
}

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).