I have SQLite database in isolated storage in Windows Store App.
I use SQLite for Windows Runtime
My class:
[Table("Projects")]
public class Project
{
[PrimaryKey]
[Column ("id")]
public int Id { get; set; }
[Column("group_id")]
public int GroupId { get; set; }
public string Name { get; set; }
}
I get data from web server and put it to local DataBase
.
When I try to store data to DataBase
, I handled exeption
e.message = table Projects has no column named Name
because DataBase
haven't column "Name"
My question is: How to use one class with fields, maping to DataBase Column
and simple fields? (I wont not include some fields to DataBase
, but I need it in class.)
UPD.
using System.ComponentModel.DataAnnotations.Schema;
[NotMapped]
public string Name { get; set; }
Error The type or namespace name 'NotMappedAttribute' does not exist in the namespace 'System.ComponentModel.DataAnnotations.Schema' (are you missing an assembly reference?)
When I try to add System.ComponentModel.DataAnnotations.dll
Error: System.ComponentModel.DataAnnotations.dll could not be added. This component is already automaticaly referenced by the build system
.