<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=ASP.NET_Tutorial%2FDevelopment%2FClass</id>
		<title>ASP.NET Tutorial/Development/Class - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=ASP.NET_Tutorial%2FDevelopment%2FClass"/>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=ASP.NET_Tutorial/Development/Class&amp;action=history"/>
		<updated>2026-04-29T18:50:47Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://nfex.ru/index.php?title=ASP.NET_Tutorial/Development/Class&amp;diff=2581&amp;oldid=prev</id>
		<title> в 15:30, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=ASP.NET_Tutorial/Development/Class&amp;diff=2581&amp;oldid=prev"/>
				<updated>2010-05-26T15:30:57Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 15:30, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://nfex.ru/index.php?title=ASP.NET_Tutorial/Development/Class&amp;diff=2582&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=ASP.NET_Tutorial/Development/Class&amp;diff=2582&amp;oldid=prev"/>
				<updated>2010-05-26T11:56:21Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Abstract class==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
public abstract class BaseEmployee&lt;br /&gt;
{&lt;br /&gt;
    public abstract decimal Salary&lt;br /&gt;
    {&lt;br /&gt;
        get;&lt;br /&gt;
    }&lt;br /&gt;
    public string Company&lt;br /&gt;
    {&lt;br /&gt;
        get { return &amp;quot;Acme Software&amp;quot;; }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
public class SalesEmployee : BaseEmployee&lt;br /&gt;
{&lt;br /&gt;
    public override decimal Salary&lt;br /&gt;
    {&lt;br /&gt;
        get { return 67000.23m; }&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
== Assign value to class public fields (C#)==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;%@ Page Language=&amp;quot;C#&amp;quot; %&amp;gt;&lt;br /&gt;
&amp;lt;script runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;
   class Clock {&lt;br /&gt;
      public int Second;&lt;br /&gt;
      public int Minute;&lt;br /&gt;
      public int Hour;&lt;br /&gt;
      void SetTime(int intSec, int intMin, int intHour) {&lt;br /&gt;
         Second = intSec;&lt;br /&gt;
         Minute = intMin;&lt;br /&gt;
         Hour = intHour;&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
   &lt;br /&gt;
   void Page_Load(Object Sender, EventArgs e) {&lt;br /&gt;
      Clock objClock = new Clock();&lt;br /&gt;
      &lt;br /&gt;
      objClock.Second = 60;&lt;br /&gt;
      Response.Write(objClock.Second);&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
== Assign value to class public field (VB)==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;%@ Page Language=&amp;quot;VB&amp;quot; %&amp;gt;&lt;br /&gt;
&amp;lt;script runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;
   Class Clock&lt;br /&gt;
      public Second as integer&lt;br /&gt;
      public Minute as integer&lt;br /&gt;
      public Hour as integer&lt;br /&gt;
      sub SetTime(intSec as integer, intMin as integer, _&lt;br /&gt;
         intHour as integer)&lt;br /&gt;
         Second = intSec&lt;br /&gt;
         Minute = intMin&lt;br /&gt;
         Hour = intHour&lt;br /&gt;
      end sub&lt;br /&gt;
   End Class&lt;br /&gt;
   &lt;br /&gt;
   sub Page_Load(Sender as object, e as EventArgs)&lt;br /&gt;
      dim objClock as new Clock&lt;br /&gt;
      &lt;br /&gt;
      objClock.Second = 60&lt;br /&gt;
      &lt;br /&gt;
      Response.Write(objClock.Second)&lt;br /&gt;
   end sub&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
== Call calss constructor to create new object (C#)==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script language=&amp;quot;C#&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;
   public class Clock {&lt;br /&gt;
      public int Second;&lt;br /&gt;
      public int Minute;&lt;br /&gt;
      public int Hour;&lt;br /&gt;
      public static int ClockCounter = 0;&lt;br /&gt;
      &lt;br /&gt;
      public static int AddClock(){&lt;br /&gt;
         ClockCounter += 1;&lt;br /&gt;
         return ClockCounter;&lt;br /&gt;
      }&lt;br /&gt;
      &lt;br /&gt;
      public void SetTime(int intSec, int intMin, int intHour) &lt;br /&gt;
      {&lt;br /&gt;
         Second = intSec;&lt;br /&gt;
         Minute = intMin;&lt;br /&gt;
         Hour = intHour;&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;HTML&amp;gt;&lt;br /&gt;
&amp;lt;BODY&amp;gt;&lt;br /&gt;
   &amp;lt;%&lt;br /&gt;
      Clock objClock = new Clock();&lt;br /&gt;
      objClock.SetTime(4,6,45);&lt;br /&gt;
      &lt;br /&gt;
      Clock.AddClock();&lt;br /&gt;
      Response.Write(Clock.ClockCounter);&lt;br /&gt;
   %&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;/BODY&amp;gt;&amp;lt;/HTML&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
== Call class constructor to create new object (VB)==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script language=&amp;quot;VB&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;
   public class Clock &lt;br /&gt;
      public Second as integer&lt;br /&gt;
      public Minute as integer&lt;br /&gt;
      public Hour as integer&lt;br /&gt;
      public ClockCounter as integer = 0&lt;br /&gt;
      &lt;br /&gt;
      public sub SetTime(intSec as integer, intMin as integer, _&lt;br /&gt;
         intHour as integer) &lt;br /&gt;
         Second = intSec&lt;br /&gt;
         Minute = intMin&lt;br /&gt;
         Hour = intHour&lt;br /&gt;
      end sub&lt;br /&gt;
      &lt;br /&gt;
   end class&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;HTML&amp;gt;&lt;br /&gt;
&amp;lt;BODY&amp;gt;&lt;br /&gt;
   &amp;lt;%&lt;br /&gt;
      dim objClock as new Clock()&lt;br /&gt;
      objClock.SetTime(4,6,45)&lt;br /&gt;
      &lt;br /&gt;
      Response.Write(objClock.ClockCounter)&lt;br /&gt;
   &lt;br /&gt;
   %&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;/BODY&amp;gt;&amp;lt;/HTML&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
== Create read-only properties==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
File: ServerTime.cs&lt;br /&gt;
using System;&lt;br /&gt;
&lt;br /&gt;
public class ServerTime&lt;br /&gt;
{&lt;br /&gt;
    public string CurrentTime&lt;br /&gt;
    {&lt;br /&gt;
        get&lt;br /&gt;
        {&lt;br /&gt;
            return DateTime.Now.ToString();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
== Creating Partial Classes==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
File: FirstHalf.cs&lt;br /&gt;
public partial class Tweedle&lt;br /&gt;
{&lt;br /&gt;
    private string _message = @&amp;quot;fir&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
File: SecondHalf.cs&lt;br /&gt;
public partial class Tweedle&lt;br /&gt;
{&lt;br /&gt;
    public string GetMessage()&lt;br /&gt;
    {&lt;br /&gt;
        return _message;&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
== Declaring Constructors==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
A constructor is called when you create a new instance of a class. &lt;br /&gt;
File: Quote.cs&lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections.Generic;&lt;br /&gt;
public class Quote&lt;br /&gt;
{&lt;br /&gt;
    private List&amp;lt;string&amp;gt; _quotes = new List&amp;lt;string&amp;gt;();&lt;br /&gt;
    public string GetQuote()&lt;br /&gt;
    {&lt;br /&gt;
        Random rnd = new Random();&lt;br /&gt;
        return _quotes[rnd.Next(_quotes.Count)];&lt;br /&gt;
    }&lt;br /&gt;
    public Quote()&lt;br /&gt;
    {&lt;br /&gt;
        _quotes.Add(&amp;quot;A&amp;quot;);&lt;br /&gt;
        _quotes.Add(&amp;quot;B&amp;quot;);&lt;br /&gt;
        _quotes.Add(&amp;quot;C&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
== Declaring Interfaces==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
An interface is a list of properties and methods that a class must implement. &lt;br /&gt;
public interface IProduct&lt;br /&gt;
{&lt;br /&gt;
    decimal Price&lt;br /&gt;
    {&lt;br /&gt;
        get;&lt;br /&gt;
    }&lt;br /&gt;
    void SaveProduct();&lt;br /&gt;
}&lt;br /&gt;
public class MusicProduct : IProduct&lt;br /&gt;
{&lt;br /&gt;
    public decimal Price&lt;br /&gt;
    {&lt;br /&gt;
        get { return 12.99m; }&lt;br /&gt;
    }&lt;br /&gt;
    public void SaveProduct()&lt;br /&gt;
    {&lt;br /&gt;
        // Save Music Product&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
public class BookProduct : IProduct&lt;br /&gt;
{&lt;br /&gt;
    public decimal Price&lt;br /&gt;
    {&lt;br /&gt;
        get { return 23.99m; }&lt;br /&gt;
    }&lt;br /&gt;
    public void SaveProduct()&lt;br /&gt;
    {&lt;br /&gt;
        // Save Book Product&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
== Declaring Namespaces==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
A namespace enables you to group related classes. &lt;br /&gt;
Namespaced.cs&lt;br /&gt;
namespace AspNetUnleashed.SampleCode&lt;br /&gt;
{&lt;br /&gt;
    public class Namespaced&lt;br /&gt;
    {&lt;br /&gt;
        public string SaySomething()&lt;br /&gt;
        {&lt;br /&gt;
            return &amp;quot;Something&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
== Define and use class in asp.net page (C#)==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;%@ Page Language=&amp;quot;C#&amp;quot; %&amp;gt;&lt;br /&gt;
&amp;lt;script runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;
   class MyValueClass {&lt;br /&gt;
      public DateTime dtBirthDay = new DateTime(1999,6,27);&lt;br /&gt;
      public string GetDayOfWeek() {&lt;br /&gt;
         return(dtBirthDay.DayOfWeek.ToString());&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
   void Button_Click(Object Sender, EventArgs e) {&lt;br /&gt;
      MyValueClass objMyValueClass = new MyValueClass();&lt;br /&gt;
      Response.Write(objMyValueClass.GetDayOfWeek());&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&lt;br /&gt;
   &amp;lt;form runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;asp:button id=&amp;quot;btSubmit&amp;quot; Text=&amp;quot;Submit&amp;quot; runat=server OnClick=&amp;quot;Button_Click&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;/form&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
== Define and use class in asp.net page (VB)==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;%@ Page Language=&amp;quot;VB&amp;quot; %&amp;gt;&lt;br /&gt;
&amp;lt;script runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;
   class MyValueClass&lt;br /&gt;
      public dtBirthDay as new DateTime(1983,6,27)&lt;br /&gt;
      function GetDayOfWeek() as String&lt;br /&gt;
         return dtBirthDay.DayOfWeek.ToString()&lt;br /&gt;
      end function&lt;br /&gt;
   end class&lt;br /&gt;
   sub Button_Click(Sender as Object, e as EventArgs)&lt;br /&gt;
      dim objMyValueClass as new MyValueClass()&lt;br /&gt;
      Response.Write(objMyValueClass.GetDayOfWeek())&lt;br /&gt;
   end sub&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
   &amp;lt;form runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;asp:button id=&amp;quot;btSubmit&amp;quot; Text=&amp;quot;Submit&amp;quot; runat=server OnClick=&amp;quot;Button_Click&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;/form&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
== Inheritance and Abstract Classes==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
public class BaseProduct&lt;br /&gt;
{&lt;br /&gt;
    private decimal _price;&lt;br /&gt;
    public decimal Price&lt;br /&gt;
    {&lt;br /&gt;
        get { return _price; }&lt;br /&gt;
        set { _price = value; }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
public class ComputerProduct : BaseProduct&lt;br /&gt;
{&lt;br /&gt;
    private string _processor;&lt;br /&gt;
    public string Processor&lt;br /&gt;
    {&lt;br /&gt;
        get { return _processor; }&lt;br /&gt;
        set { _processor = value; }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
public class TelevisionProduct : BaseProduct&lt;br /&gt;
{&lt;br /&gt;
    private bool _isHDTV;&lt;br /&gt;
    public bool IsHDTV&lt;br /&gt;
    {&lt;br /&gt;
        get { return _isHDTV; }&lt;br /&gt;
        set { _isHDTV = value; }&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
== Overloading is useful when you want to associate related methods.==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
using System;&lt;br /&gt;
&lt;br /&gt;
public class StoreProduct&lt;br /&gt;
{&lt;br /&gt;
    public void SaveProduct(string name)&lt;br /&gt;
    {&lt;br /&gt;
        SaveProduct(name, 0, String.Empty);&lt;br /&gt;
    }&lt;br /&gt;
    public void SaveProduct(string name, decimal price)&lt;br /&gt;
    {&lt;br /&gt;
        SaveProduct(name, price, String.Empty);&lt;br /&gt;
    }&lt;br /&gt;
    public void SaveProduct(string name, decimal price, string description)&lt;br /&gt;
    {&lt;br /&gt;
        // Save name, price, description to database&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
File: ProductConstructor.cs&lt;br /&gt;
using System;&lt;br /&gt;
&lt;br /&gt;
public class ProductConstructor&lt;br /&gt;
{&lt;br /&gt;
    public ProductConstructor(string name)&lt;br /&gt;
        : this(name, 0, String.Empty) { }&lt;br /&gt;
    public ProductConstructor(string name, decimal price)&lt;br /&gt;
        : this(name, price, String.Empty) { }&lt;br /&gt;
    public ProductConstructor(string name, decimal price, string description)&lt;br /&gt;
    {&lt;br /&gt;
        // Use name, price, and description&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
== Override a property or method of a base class==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
public class ProductBase&lt;br /&gt;
{&lt;br /&gt;
    private decimal _price;&lt;br /&gt;
    public virtual decimal Price&lt;br /&gt;
    {&lt;br /&gt;
        get { return _price; }&lt;br /&gt;
        set { _price = value; }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
public class OnSaleProduct : ProductBase&lt;br /&gt;
{&lt;br /&gt;
    override public decimal Price&lt;br /&gt;
    {&lt;br /&gt;
        get { return base.Price / 2; }&lt;br /&gt;
        set { base.Price = value; }&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>