public Project Insert(Project project) { project.ProjectNo = counterRepo.GetNextCounter("project").CounterValue; project.CreatedOn = DateTime.Now; Collection.InsertOne(project); return(project); }
public Step InsertStep(Step step) { step.StepNo = counterRepo.GetNextCounter("step").CounterValue; step.CreatedOn = DateTime.Now; if (step.Invocations == null) { step.Invocations = new List <Invocation>(); } var scenarioFilter = Builders <Scenario> .Filter.Eq(sc => sc.ScenarioNo, step.ScenarioNo); var addStep = Builders <Scenario> .Update.Push("Steps", step); Collection.FindOneAndUpdate(scenarioFilter, addStep); return(step); }