public JsonResult AddTable(string Table, string Info) { using (var db = DBLink.CreateDB()) try { string GUID = Guid.NewGuid().ToString(); var table = JsonConvert.DeserializeObject <T_Table>(Table); table.GUID = GUID; var LInfo = JsonConvert.DeserializeObject <List <T_Table_Info> >(Info); foreach (var item in LInfo) { item.Table_GUID = GUID; } db.Ado.BeginTran(); db.Insertable <T_Table>(table).ExecuteCommand(); db.Insertable <T_Table_Info>(LInfo).ExecuteCommand(); db.Ado.CommitTran(); return(Json(new { status = 1, data = "", msg = "" })); } catch (Exception ex) { return(Json(new { status = 0, data = "", msg = ex.Message })); } }
/// <summary> /// 开始生成 /// </summary> /// <returns></returns> public JsonResult StartGenerate(string Data) { using (var db = DBLink.CreateDB()) try { // db.CodeFirst.BackupTable().InitTables(typeof(CodeTable), typeof(CodeTable2)); return(null); } catch (Exception ex) { throw; } }