public IActionResult Add()
        {
            var model = new CompanyUpdateModel();

            model.Roles = model.GetAllRoles();
            return(View(model));
        }
 public async Task <IActionResult> Add(CompanyUpdateModel model)
 {
     if (ModelState.IsValid)
     {
         if (string.IsNullOrWhiteSpace(model.Name))
         {
             await model.UserAssignToRoles();
         }
         else
         {
             await model.AddNewCompany();
         }
     }
     model.Roles = model.GetAllRoles();
     return(View(model));
 }