示例#1
0
    public string Check(List <string> arguments)
    {
        string checkThisId = arguments[0];

        Unit unit = (Unit)Harvesters.FirstOrDefault(h => h.Id == checkThisId) ?? Providers.FirstOrDefault(p => p.Id == checkThisId);

        if (unit != null)
        {
            return(unit.ToString());
        }
        //return $"No element found with id - {checkThisId}";
        return(string.Format(Messages.UnitNotFound, checkThisId));
    }
示例#2
0
    public string Check(List <string> arguments)
    {
        var id        = arguments[0];
        var harvester = Harvesters.FirstOrDefault(h => h.Id == id);
        var provider  = Providers.FirstOrDefault(p => p.Id == id);

        if (harvester != null)
        {
            return(harvester.ToString());
        }
        else if (provider != null)
        {
            return(provider.ToString());
        }

        return($"No element found with id - {id}");
    }