예제 #1
0
        public ServiceResult Get(string name)
        {
            if (string.IsNullOrWhiteSpace(name))
            {
                return(ServiceResponse.Error("You must provide a name for the Attribute."));
            }

            if (CurrentUser == null)
            {
                return(ServiceResponse.Error("You must be logged in to access this function."));
            }

            AttributeManager     AttributeManager = new AttributeManager(Globals.DBConnectionKey, this.GetAuthToken(Request));
            List <TMG.Attribute> s = AttributeManager.Search(name);

            if (s == null || s.Count == 0)
            {
                return(ServiceResponse.Error("TMG.Attribute could not be located for the name " + name));
            }

            return(ServiceResponse.OK("", s));
        }