Hi,
I am trying to use the new DAL 2 features and I am getting an error I can not quite figure out. I have created a data model for my table called Albums which has a primary key of AlbumId. see the model below. when I try to call the insert method based on Charles Nurse's DAL2 blogs I get an error "Invalid Column "ID".
I do not use ID anywhere in my project or database so I can not understand what this is referring to. I know in Charles' blogs he has the primary key for some examples as ID but in others the key is TaskID...
...confused...thanks for the help
public void CreateAlbum(Album album)
{
using(IDataContext ctx = DataContext.Instance())
{
var rep = ctx.GetRepository<
Album
>();
rep.Insert(album);
}
}
public class Album
{
[TableName("Albums")]
[PrimaryKey("AlbumId", AutoIncrement = true)]
public int AlbumId { get; set; }
public int PortalId { get; set; }
public int CreatedByUserId { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public bool AllowComments { get; set; }
public bool Private { get; set; }
public string Path { get; set; }
public int ImageCount { get; set; }
public int ParentId { get; set; }
public bool InheritPermissions { get; set; }
public bool InheritSettings { get; set; }
public bool isApproved { get; set; }
public bool isDefault { get; set; }
public int AlbumImageId { get; set; }
public string Reference { get; set; }
public DateTime CreatedDate { get; set; }
public DateTime ModifiedDate { get; set; }
}