예제 #1
0
        public async Task DeleteObjectAsync(RefIdentityDto input)
        {
            var objExist = _repository.FirstOrDefault(input.Id);

            if (objExist != null)
            {
                await _repository.DeleteAsync(objExist);
            }
            else
            {
                throw new UserFriendlyException("Item Not Found");
            }
        }
예제 #2
0
        public async Task UpdateObject(RefIdentityDto input)
        {
            var obj = _repository.FirstOrDefault(input.Id);

            obj.Name = input.Name;
            if (obj != null)
            {
                await _repository.UpdateAsync(obj);
            }
            else
            {
                throw new UserFriendlyException("Item Not Found");
            }
        }
예제 #3
0
        public async Task <ActionResult> EditIdentity(int id, RefIdentityDto collection)
        {
            try
            {
                // TODO: Add update logic here
                if (ModelState.IsValid)
                {
                    await this.refIdentityAppService.UpdateObject(collection);

                    return(RedirectToAction("CreateIdentityType"));
                }
                else
                {
                    return(View(collection));
                }
            }
            catch
            {
                return(View());
            }
        }