/// <summary>
        /// 编辑公告
        /// </summary>
        public virtual async Task UpdateNoticeAsync(NoticeEditDto input)
        {
            //TODO:更新前的逻辑判断,是否允许更新

            var entity = await noticeservice.GetAsync(input.Id.Value);

            input.MapTo(entity);

            await noticeservice.UpdateAsync(entity);
        }
        /// <summary>
        /// 新增公告
        /// </summary>
        public virtual async Task <NoticeEditDto> CreateNoticeAsync(NoticeEditDto input)
        {
            //TODO:新增前的逻辑判断,是否允许新增

            var entity = input.MapTo <Notice>();

            entity = await noticeservice.InsertAsync(entity);

            return(entity.MapTo <NoticeEditDto>());
        }
Example #3
0
 public NoticeEditViewModel(NoticeEditDto dto)
 {
     dto.MapTo(this);
 }