/// <summary> /// 添加一条测试数据 /// </summary> /// <returns></returns> public string AddTest() { var a = Convert.ToInt32("dsads"); Domain.Domains.Tests.Test1 test = new Domain.Domains.Tests.Test1(); test.HelloWorld = "你好世界"; EfContent.Add(test); EfContent.SaveChanges(); return("写入成功"); }
public test2 TestAddTest2(test2 test22, int testId) { var test = EfContent.Where <Test1>(p => p.Id == testId).FirstOrDefault(); var tset23 = test.AddTest2(test22); EfContent.Add(tset23); EfContent.SaveChanges(); return(tset23); }