我正在尝试按照下面的代码保存对象,但是没有引发错误,记录未插入表中。
VS 2017
using (MainDataContext db = new MainDataContext(model.ConnectionString))
{
Child kid = JsonConvert.DeserializeObject<Child>(JsonConvert.SerializeObject(model));
kid.DTStamp = DateTime.Now;
db.Child.InsertOnSubmit(kid);
db.SubmitChanges();
return new ApiResponse(System.Net.HttpStatusCode.OK) { ResponseMessage = "Child added successfully", ResponseObject = kid.ChildID };
}