Beispiel #1
0
 public async Task <IActionResult> Get(string alliance)
 {
     if (alliance.ToUpper() == "RED" || alliance.ToUpper() == "BLUE")
     {
         Domain.SwitchSettings domain_SwitchSettings;
         if (alliance.ToUpper() == "RED")
         {
             domain_SwitchSettings = _fieldSettings.RedSwitchSettings;
         }
         else
         {
             domain_SwitchSettings = _fieldSettings.BlueSwitchSettings;
         }
         if (domain_SwitchSettings == null)
         {
             return(NotFound(alliance));
         }
         else
         {
             return(Ok(SwitchSettingsAssembler.ToDTO(domain_SwitchSettings)));
         }
     }
     else
     {
         return(NotFound(alliance));
     }
 }
Beispiel #2
0
        public async Task <IActionResult> Get()
        {
            List <DTO.SwitchSettings> dto_SwitchSettings = new List <DTO.SwitchSettings>();

            if (_fieldSettings.RedSwitchSettings != null)
            {
                dto_SwitchSettings.Add(SwitchSettingsAssembler.ToDTO(_fieldSettings.RedSwitchSettings));
            }
            if (_fieldSettings.BlueSwitchSettings != null)
            {
                dto_SwitchSettings.Add(SwitchSettingsAssembler.ToDTO(_fieldSettings.BlueSwitchSettings));
            }
            return(Ok(dto_SwitchSettings.ToArray()));
        }