public async Task <Page <ProfileProperty> > Grid([FromBody] GridRequest gridRequest) { CheckNullBody(gridRequest); var ProfilePropertyLogic = new ProfilePropertyLogic(Cache, Context); return(await ProfilePropertyLogic.GetGrid(gridRequest)); }
public async Task <ProfileProperty> Post([FromBody] ProfileProperty profileProperty) { CheckNullBody(profileProperty); profileProperty.UpdatedBy = UserId; var ProfilePropertyLogic = new ProfilePropertyLogic(Cache, Context); return(await ProfilePropertyLogic.AddProfileProperty(profileProperty)); }
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)); }
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); }
public async Task <ProfileProperty> Get(int id) { var profilePropertyLogic = new ProfilePropertyLogic(Cache, Context); return(await profilePropertyLogic.GetProfileProperty(id, IsAdmin)); }
public async Task <List <ProfileProperty> > Get(bool requiredOnly) { var profilePropertyLogic = new ProfilePropertyLogic(Cache, Context); return(await profilePropertyLogic.GetProfileProperties(requiredOnly, IsAdmin)); }