"auto-implemented property" feature.
Hey,
Good Day!
I can't build this project.
IDE: VS2005
is it for .net framework 2.0 can't support the new feature, or other reason?
thanks!
Code:
using System;
public class Tmp3Customer
{
public int ID { get; set; }
public string Name { get; set; }
}
public class AutoImplementedCustomerManager
{
static void Main()
{
Tmp3Customer cust = new Tmp3Customer();
cust.ID = 1;
cust.Name = "Amelio Rosales";
Console.WriteLine(
"ID: {0}, Name: {1}",
cust.ID,
cust.Name);
Console.ReadKey();
}
}
Show:
....
D:\study\code\Lesson10\ConApp10\ConApp10\AutoImple mented.cs(5,21): error CS0501: 'Tmp3Customer.ID.get' must declare a body because it is not marked abstract or extern
D:\study\code\Lesson10\ConApp10\ConApp10\AutoImple mented.cs(5,26): error CS0501: 'Tmp3Customer.ID.set' must declare a body because it is not marked abstract or extern
D:\study\code\Lesson10\ConApp10\ConApp10\AutoImple mented.cs(6,26): error CS0501: 'Tmp3Customer.Name.get' must declare a body because it is not marked abstract or extern
D:\study\code\Lesson10\ConApp10\ConApp10\AutoImple mented.cs(6,31): error CS0501: 'Tmp3Customer.Name.set' must declare a body because it is not marked abstract or extern