传入POSUnitRecords列表。我试图访问表格'记录'在db' EPOSEntities'。 Foreach POS我想在'记录'中添加另一行。表
public static void UpdateDataBase(List<POSUnitRecord> POSs)
{
EPOSEntities db = new EPOSEntities();
var ent = from epos in db.Records
where epos.
//Columns in 'Records' table are 'Id' & 'Folder'
foreach (POSUnitRecord pos in POSs)
{
//fields in pos are 'Id' & 'Folder'
}
}
////////////////////////////////
public class POSUnitRecord
{
//[Key]
public int Id { get; set; }
public virtual string FolderPath { get; set; }
}
答案 0 :(得分:0)
public static void UpdateDataBase(List<POSUnitRecord> POSs)
{
EPOSEntities db = new EPOSEntities();
var ent = from epos in db.Records;
//where epos.
//Columns in 'Records' table are 'Id' & 'Folder'
foreach (POSUnitRecord pos in POSs)
{
Record aRecord = new Record();
aRecord.Id = pos.Id;
aRecord.Folder = pos.FolderPath
aRecord.New="put your value";
ent.Add(aRecord);
}
}