/// <summary> /// /// </summary> /// <param name="model"></param> /// <returns></returns> public static SchedulerModel Update(SchedulerModel model) { // get entity from database var entity = SchedulerServices.GetById(model.Id); // set new properties from model model.FillEntity(ref entity); // update entity return(new SchedulerModel(SchedulerServices.Update(entity))); }
/// <summary> /// /// </summary> /// <param name="model"></param> /// <returns></returns> public static SchedulerModel Create(SchedulerModel model) { // init entity var entity = new Scheduler(); // set properties from model model.FillEntity(ref entity); // insert entity return(new SchedulerModel(SchedulerServices.Create(entity))); }