is it possible to do this without using an "if" (asp.net mvc post action method)
according to [anti-if campaign][1]     it is a best practice not to use ifs in our code. Can anyone tell me if it possible to get rid of the if in this piece of code ?

 

     [AcceptVerbs(HttpVerbs.Post)]
     public ActionResult Create(OrganisationInput organisationInput)
     {
        if (!this.ModelState.IsValid)
        {
           return View(organisationInput.RebuildInput<Organisation, OrganisationInput>());
        }

       var organisation = organisationInput.BuildEntity<Organisation, OrganisationInput>();
       this.organisationService.Create(organisation);

       return this.RedirectToAction("Index");
    }


  [1]: http://www.antiifcampaign.com/
is it possible to do this without using an "if" (asp.net mvc post action method)
===

according to [anti-if campaign][1]     it is a best practice not to use ifs in our code. Can anyone tell me if it possible to get rid of the if in this piece of code ?

 

     [AcceptVerbs(HttpVerbs.Post)]
     public ActionResult Create(OrganisationInput organisationInput)
     {
        if (!this.ModelState.IsValid)
        {
           return View(organisationInput.RebuildInput<Organisation, OrganisationInput>());
        }

       var organisation = organisationInput.BuildEntity<Organisation, OrganisationInput>();
       this.organisationService.Create(organisation);

       return this.RedirectToAction("Index");
    }


  [1]: http://www.antiifcampaign.com/