public void UpdateTraining(Training training) { var oldTraining = GetTraining(training.Id); oldTraining.Name = training.Name; oldTraining.Code = training.Code; oldTraining.Description = training.Description; oldTraining.Designation = training.Designation; trainingRepo.SaveChanges(); }
/// <summary> /// Create a new Training object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="name">Initial value of the Name property.</param> /// <param name="code">Initial value of the Code property.</param> /// <param name="objectInfo">Initial value of the ObjectInfo property.</param> /// <param name="designation">Initial value of the Designation property.</param> public static Training CreateTraining(global::System.Int32 id, global::System.String name, global::System.String code, ObjectInfo objectInfo, global::System.String designation) { Training training = new Training(); training.Id = id; training.Name = name; training.Code = code; training.ObjectInfo = StructuralObject.VerifyComplexObjectIsNotNull(objectInfo, "ObjectInfo"); training.Designation = designation; return training; }
public static TrainingModel FromDomainModel(Training training) { return new TrainingModel { Id = training.Id, Name = training.Name, Description = training.Description, Code = training.Code, Designation = training.Designation }; }
/// <summary> /// Deprecated Method for adding a new object to the Trainings EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToTrainings(Training training) { base.AddObject("Trainings", training); }