Ejemplo n.º 1
0
        internal void CreateProfile(string profileName, string displayDeviceName, string displaySettings, string audioDeviceName)
        {
            validateProfile(profileName, displayDeviceName, displaySettings, audioDeviceName);
            DisplayDevicesManager.DEVMODE devMode = displayDevicesManager.GetDevModeForDisplaySettings(displaySettings);
            Profile newProfile = CreateProfileFromInput(profileName, displayDeviceName, devMode, audioDeviceName);

            profileCollection.AddProfile(newProfile);
            WriteProfileListToDataFile();
        }
Ejemplo n.º 2
0
        public IActionResult Post([FromBody] Profile value)
        {
            if (value == null)
            {
                return(BadRequest());
            }

            if (_collection.AddProfile(value))
            {
                return(CreatedAtRoute($"/api/[controller]/{value.UserID}", value));
            }

            return(BadRequest());
        }