Esempio n. 1
0
        public async Task <Page <ProfileProperty> > Grid([FromBody] GridRequest gridRequest)
        {
            CheckNullBody(gridRequest);

            var ProfilePropertyLogic = new ProfilePropertyLogic(Cache, Context);

            return(await ProfilePropertyLogic.GetGrid(gridRequest));
        }
Esempio n. 2
0
        public async Task <ProfileProperty> Post([FromBody] ProfileProperty profileProperty)
        {
            CheckNullBody(profileProperty);

            profileProperty.UpdatedBy = UserId;

            var ProfilePropertyLogic = new ProfilePropertyLogic(Cache, Context);

            return(await ProfilePropertyLogic.AddProfileProperty(profileProperty));
        }
Esempio n. 3
0
        public async Task <ProfileProperty> Put(int id, [FromBody] ProfileProperty profileProperty)
        {
            CheckNullBody(profileProperty);

            profileProperty.ProfilePropertyId = id;
            profileProperty.UpdatedBy         = UserId;

            var ProfilePropertyLogic = new ProfilePropertyLogic(Cache, Context);

            return(await ProfilePropertyLogic.UpdateProfileProperty(profileProperty));
        }
Esempio n. 4
0
        private async Task <ProfileProperty> ValidateProfilePropertyForSearch(UserSearch search)
        {
            var profilePropertyLogic = new ProfilePropertyLogic(Cache, Context);

            var property = search.ProfilePropertyId.HasValue ?
                           await profilePropertyLogic.GetProfileProperty(search.ProfilePropertyId.Value, search.IsAdmin) :
                           await profilePropertyLogic.GetProfileProperty(search.ProfilePropertyName, search.IsAdmin);

            if (property == null)
            {
                throw new CallerException("Specified profile property does not exist, or you do not have sufficient security privileges to access it");
            }

            // Non admins can only search Public profile properties.
            if (property.Visibility != ProfilePropertyVisibility.Public && !search.IsAdmin)
            {
                throw new CallerException("Specified profile property is not public, and therefore not searchable");
            }

            return(property);
        }
Esempio n. 5
0
        public async Task <ProfileProperty> Get(int id)
        {
            var profilePropertyLogic = new ProfilePropertyLogic(Cache, Context);

            return(await profilePropertyLogic.GetProfileProperty(id, IsAdmin));
        }
Esempio n. 6
0
        public async Task <List <ProfileProperty> > Get(bool requiredOnly)
        {
            var profilePropertyLogic = new ProfilePropertyLogic(Cache, Context);

            return(await profilePropertyLogic.GetProfileProperties(requiredOnly, IsAdmin));
        }