public async Task <ApiRequestResult> AddAsync(MemberLevelDto dto)
        {
            var command = dto.EntityMap <MemberLevelDto, MemberLevel>();
            await _memberLevelRepository.AddAsync(command);

            return(ApiRequestResult.Success("添加成功"));
        }
        public async Task <ApiRequestResult> UpdateAsync(MemberLevelDto dto)
        {
            var entity = await _memberLevelRepository.GetAsync(dto.Id.Value);

            var newEntity = dto.EntityMap(entity);
            await _memberLevelRepository.UpdateAsync(newEntity);

            return(ApiRequestResult.Success("修改成功"));
        }
Example #3
0
        public ActionResult Update(MemberLevelDto dto)
        {
            var result = _memberlevelContract.Update(dto);

            return(Json(result, JsonRequestBehavior.AllowGet));
        }