Blog.Admin.Web.Controllers.UserRoleController.Edit C# (CSharp) Method

Edit() public method

public Edit ( string id ) : Task
id string
return Task
        public async Task<ActionResult> Edit(string id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            var role = await RoleManager.FindByIdAsync(id);
            if (role == null)
            {
                return HttpNotFound();
            }
            var userRoleViewModel = new UserRoleViewModel
            {
                Id = role.Id,
                Name = role.Name,
                Description = role.Description
            };

            // Update the new Description property for the ViewModel:
            return View(userRoleViewModel);
        }

Same methods

UserRoleController::Edit ( [ Include = "Name,Id,Description")]UserRoleViewModeluserRoleViewModel ) : Task