public async Task<ActionResult> Create(RoleCreateModel model) { var role = new Role(); if (!TryUpdateModel(role, model)) { return Template(model.CreateTemplate(ControllerContext)); } var db = MaintDbContext; db.Roles.Add(role); await db.SaveChangesAsync(); await SetFlashAsync(new FlashMessage { Text = MaintCultureTextResources.SuccessToSave, MessageType = FlashMessageType.Success, }); return Create(); }
public ActionResult Create() { RoleCreateModel model = new RoleCreateModel(); return Template(model.CreateTemplate(ControllerContext)); }