示例#1
0
        /// <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)));
        }
示例#2
0
        /// <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)));
        }