public async Task <object> Post([FromBody] dynamic model)
        {
            // Create AppPool
            ApplicationPool pool = AppPoolHelper.CreateAppPool(model);

            if (!await IsAppPoolIdentityAllowed(pool))
            {
                return(null);
            }

            // Save it
            ManagementUnit.ServerManager.ApplicationPools.Add(pool);
            ManagementUnit.Current.Commit();

            // Refresh
            pool = AppPoolHelper.GetAppPool(pool.Name);

            //
            // Create response
            dynamic appPool = (dynamic)AppPoolHelper.ToJsonModel(pool, Context.Request.GetFields());

            // A newly created application should default to started state
            var state = WaitForPoolStatusResolve(pool);

            appPool.status = Enum.GetName(typeof(Status), state == Status.Unknown ? Status.Started : state).ToLower();

            return(Created((string)AppPoolHelper.GetLocation(appPool.id), appPool));
        }
        public object Post([FromBody] dynamic model)
        {
            // Create AppPool
            ApplicationPool pool = AppPoolHelper.CreateAppPool(model);

            EnsureAppPoolIdentityAllowed(pool);

            // Save it
            ManagementUnit.ServerManager.ApplicationPools.Add(pool);
            ManagementUnit.Current.Commit();

            // Refresh
            pool = AppPoolHelper.GetAppPool(pool.Name);

            WaitForPoolStatusResolve(pool);

            //
            // Create response
            dynamic appPool = (dynamic)AppPoolHelper.ToJsonModel(pool, Context.Request.GetFields());

            // A newly created application should default to started state
            if (pool.State == ObjectState.Unknown)
            {
                appPool.status = Enum.GetName(typeof(Status), Status.Started).ToLower();
            }

            return(Created((string)AppPoolHelper.GetLocation(appPool.id), appPool));
        }