I am a beginner in LINQ.
I am using .NET 3.5. and VS 2008.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Linq.Mapping;
using System.Data.Linq.Provider;
namespace LINQ_to_SQL_Test
{
[Table(Name="Person")]
public class Person
{
[Column(Name="ID", Storage="_ID", DbType="IS NOT NULL IDENTITY", Id=true, AutoGen=true)]
public int ID { get; set; }
public int IDRole { get; set; }
public string LastName { get; set; }
public string FirstName { get; set; }
}
}
The program was unable to find the definitions for Id and AutoGen in Column attribute.
What can I do?
By “[t]he program” I am assuming that you are referring to a C# compiler, and probably
cscinstalled with Visual Studio 2008.The syntax that you are using to set the properties of the
ColumnAttributeis outdated; I believe that syntax was correct when LINQ was released as a CTP. The correct syntax now is:That is,
Idhas been replaced byIsPrimaryKeyandAutoGenhas been replaced byIsDbGenerated.