示例#1
0
        public async Task <SettingsRestrictedWordDto> UpdateRestrictedWord(long id, SettingsRestrictedWordDto dto)
        {
            var entity = await _settingsRestrictedWordManager.Find(id);

            if (entity == null)
            {
                return(null);
            }
            entity = await _settingsRestrictedWordManager.Update(_mapper.Map(dto, entity));

            return(_mapper.Map <SettingsRestrictedWordDto>(entity));
        }
示例#2
0
        public async Task <SettingsRestrictedWordDto> CreateRestrictedWord(SettingsRestrictedWordDto dto)
        {
            var entity = await _settingsRestrictedWordManager.Create(_mapper.Map <SettingsRestrictedWordEntity>(dto));

            return(_mapper.Map <SettingsRestrictedWordDto>(entity));
        }