日期:2014-05-20  浏览次数:20699 次

Linq 如何新增记录
如题:

  Entity.Log log = new Entity.Log();

  log.Date = DateTime.Now;
  log.Thread = System.Threading.Thread.CurrentThread.Name;
  log.Level = "Error";
  log.Logger = loggerName;
  log.Message = msg;
  log.Exception = "";

然后要怎么做 ? 
  Entity.DBContextDataContext DBContext = new Entity.DBContextDataContext();
  DBContext.Log 后面怎么没有 Add方法 ?求教

------解决方案--------------------
探讨

DBContext.Log.insertSubmit(log);

------解决方案--------------------
logDataContext db = new logDataContext();
var newl = new Entity.Log 
{};
db.log.InsertOnSubmit(newl);
db.SubmitChanges();