public ExtendedUserProfileContract[] FindExtendedUserProfile(UserProfileDiscriminator d) { try { using (var records = RepositoryFactory.GetUserProfile()) { records.Discriminator = d; return(records.OfType <DB.UserProfile>().Select(r => new ExtendedUserProfileContract() { UserProfile = r, WebPagesMembership = r.webpages_Membership, UserRoles = r.webpages_UsersInRoles.Select(x => x.webpages_Role) }).ToArray()); } } catch (Exception ex) { HandleMyException(ex); return(null); } }
public UserProfileContract[] FindUserProfile(UserProfileDiscriminator d) { try { using (var records = RepositoryFactory.GetUserProfile()) { records.Discriminator = d; return(records.Select(r => new UserProfileContract() { UserProfile = r }).ToArray()); } } catch (Exception ex) { HandleMyException(ex); return(null); } }
public RoleContract[] GetRolesForUser(UserProfileDiscriminator d) { try { using (var repository = RepositoryFactory.GetUserProfile()) { repository.Discriminator = d; var users_in_roles = repository.OfType <DB.UserProfile>().SelectMany(p => p.webpages_UsersInRoles); return(users_in_roles.Select(uir => uir.webpages_Role).Distinct().Select(r => new RoleContract() { Role = r }).ToArray()); } } catch (Exception ex) { HandleMyException(ex); return(null); } }
public OwnerVsLocationContract[] FindOwnerVsLocation(OwnerVsLocationDiscriminator o, LocationDiscriminator l, UserProfileDiscriminator p) { try { using (var records = RepositoryFactory.GetOwnerVsLocation()) { records.Discriminator = o; records.LocationFilter = l; return(records.Select(r => new OwnerVsLocationContract() { OwnerVsLocation = r }).ToArray()); } } catch (Exception ex) { HandleMyException(ex); return(null); } }
public LocationContract[] FindLocation(LocationDiscriminator d, OwnerVsLocationDiscriminator o, UserProfileDiscriminator u) { try { using (var records = RepositoryFactory.GetLocation()) { records.Discriminator = d; records.OwnerVsLocationFilter = o; records.UserProfileFilter = u; return(records.Select(r => new LocationContract() { Location = r }).ToArray()); } } catch (Exception ex) { HandleMyException(ex); return(null); } }