예제 #1
0
        public AppServersRoutingProfiles.AppServersRoutingProfile Put(int subscriptionId, int appServersRoutingProfileId, [FromBody] AppServersRoutingProfiles.AppServersRoutingProfile appServersRoutingProfile)
        {
            var profile = _routingProfiles
                          .Single(r =>
                                  r.href == $"thingpark/wireless/rest/subscriptions/{subscriptionId}/appServersRoutingProfiles/{appServersRoutingProfileId}");

            profile.name = appServersRoutingProfile.name;
            return(appServersRoutingProfile);
        }
예제 #2
0
        public AppServersRoutingProfiles.AppServersRoutingProfile Post(int subscriptionId, [FromBody] AppServersRoutingProfiles.AppServersRoutingProfile appServersRoutingProfile)
        {
            var newProfile = new AppServersRoutingProfiles.Brief
            {
                name = appServersRoutingProfile.name,
                href = $"thingpark/wireless/rest/subscriptions/{subscriptionId}/appServersRoutingProfiles/{++_profileSequenceId}"
            };

            _routingProfiles.Add(newProfile);
            Response.Headers.Add("Location", newProfile.href);

            return(appServersRoutingProfile);
        }