public async Task <IResultModel> Add(MenuButtonAddModel model)
        {
            var entity = _mapper.Map <MenuButtonEntity>(model);
            var result = await _repository.InsertAsync(entity);

            return(ResultModel.Result(result));
        }
 /// <summary>
 /// 保存
 /// </summary>
 /// <param name="menuButtonEntity">表单按钮对象</param>
 /// <param name="keyValue">按钮Id</param>
 public Task Save(MenuButtonEntity menuButtonEntity, string keyValue)
 {
     if (!string.IsNullOrEmpty(keyValue))
     {
         menuButtonEntity.AttachModifyInfo(keyValue, context);
         return(menuButtonRepo.UpdateAsync(menuButtonEntity));
     }
     else
     {
         menuButtonEntity.AttachCreateInfo(context);
         return(menuButtonRepo.InsertAsync(menuButtonEntity));
     }
 }