Esempio n. 1
0
        public async Task <ActionResult> Delete(Guid id, FormCollection collection)
        {
            try
            {
                await _primaryObjectService.DeleteAsync(id);

                return(RedirectToAction("Index"));
            }
            catch (Exception ex)
            {
                var model = new Models.PrimaryObject()
                {
                    Id               = id,
                    Description      = collection[nameof(Models.PrimaryObject.Description)],
                    Name             = collection[nameof(Models.PrimaryObject.Name)],
                    SecondaryObjects = new Models.SecondaryObject[0],
                };

                return(View(model));
            }
        }
 public async Task DeleteAsync(Guid id)
 {
     await _primaryObjectService.DeleteAsync(id);
 }