[Table(Name="tags")]
public class Tag
{
[Column(Name="tagId",IsPrimaryKey=true,DbType="varchar(50)")]
public Guid TagId { get; set; }
[Column(Name = "title")]
public string Title { get; set; }
[Column(Name = "createdDate")]
public DateTime CreatedDate { get; set; }
}
public class TagDataContext : DataContext
{
public Table<Tag> Tag;
public TagDataContext(SQLiteConnection con) : base(con) { }
}
更新代码:
C# code
string strcon = "Data Source = notesdb.db3;pooling=true;failifmissing=false;";
TagDataContext ctx = new TagDataContext(new SQLiteConnection(strcon));
Tag t = ctx.Tag.Single(x => x.Title == "99999");
t.Title = "呵呵";
ctx.SubmitChanges();