public bool PostUserProfile(UserProfileDAO uspro) { UserProfileServiceClient client = new UserProfileServiceClient(); try { bool result = client.CreateUserProfile(uspro); return result; } catch (FaultException<KaskServiceException> e) { throw new HttpException(e.Message); } }
public UserProfileDAO GetUserProfile(int id) { UserProfileServiceClient client = new UserProfileServiceClient(); try { UserProfileDAO result = client.GetUserProfileByID(id); return result; } catch (FaultException<KaskServiceException> e) { throw new HttpException(e.Message); } }
public IEnumerable<UserProfileDAO> GetUserProfiles() { UserProfileServiceClient client = new UserProfileServiceClient(); try { IEnumerable<UserProfileDAO> result = client.GetUserProfiles(); return result; } catch (FaultException<KaskServiceException> e) { throw new HttpException(e.Message); } }
public bool DeleteUserProfile(int id) { try { UserProfileServiceClient client = new UserProfileServiceClient(); if (client.DeleteUserProfile(id)) return true; } catch (FaultException<KaskServiceException> e) { throw new HttpException(e.Message); } return false; }