public void Create(CaseModel caseItem, int projectId) { var newCase = new TestCases { Title = caseItem.Title, DoneText = caseItem.DoneText, StartPage = caseItem.StartPage, FinishPage = caseItem.FinishPage, TaskText = caseItem.TaskText, AmountOfTesters = caseItem.AmountOfTesters, ProjectId = projectId, Token = Guid.NewGuid().ToString() }; this.db.TestCases.AddObject(newCase); this.db.SaveChanges(); }
/// <summary> /// Create a new TestCases object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="title">Initial value of the Title property.</param> /// <param name="doneText">Initial value of the DoneText property.</param> /// <param name="taskText">Initial value of the TaskText property.</param> /// <param name="startPage">Initial value of the StartPage property.</param> /// <param name="finishPage">Initial value of the FinishPage property.</param> /// <param name="amountOfTesters">Initial value of the AmountOfTesters property.</param> /// <param name="projectId">Initial value of the ProjectId property.</param> /// <param name="token">Initial value of the Token property.</param> public static TestCases CreateTestCases(global::System.Int32 id, global::System.String title, global::System.String doneText, global::System.String taskText, global::System.String startPage, global::System.String finishPage, global::System.Int32 amountOfTesters, global::System.Int32 projectId, global::System.String token) { TestCases testCases = new TestCases(); testCases.Id = id; testCases.Title = title; testCases.DoneText = doneText; testCases.TaskText = taskText; testCases.StartPage = startPage; testCases.FinishPage = finishPage; testCases.AmountOfTesters = amountOfTesters; testCases.ProjectId = projectId; testCases.Token = token; return testCases; }
/// <summary> /// Deprecated Method for adding a new object to the TestCases EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToTestCases(TestCases testCases) { base.AddObject("TestCases", testCases); }