Beispiel #1
0
        public async Task EditAsync(LeadSourceEditModel model)
        {
            var item = await _repository.GetAsync(model.Id);

            LeadSourceFactory.Create(model, item, _userId);
            _repository.Edit(item);
            await _unitOfWork.SaveChangesAsync();
        }
        public async Task <IActionResult> Edit([FromBody] LeadSourceEditModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState.GetErrorList()));
            }

            try
            {
                await _manager.EditAsync(model);
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }

            return(Ok());
        }
Beispiel #3
0
 public static void Create(LeadSourceEditModel model, LeadSource entity, string userId)
 {
     entity.Name = model.Name;
 }