Exemple #1
0
        public ProfileEntity GetProfile(ProfileQueryEntity queryEntity)
        {
            CPDataContext ctx = new CPDataContext(OperationType.Action);

            var query = from profile in ctx.ProfileEntities
                        where profile.ApplicationId2 == queryEntity.ApplicationId &&
                        profile.InUser == queryEntity.InUser &&
                        profile.ProfileType == queryEntity.ProfileType
                        select profile;

            ProfileEntity result = query.FirstOrDefault();

            return(result);
        }
Exemple #2
0
        public List <ProfileEntity> GetProfiles(ProfileQueryEntity queryEntity)
        {
            CPDataContext ctx = new CPDataContext(OperationType.Query);

            var query = from profile in ctx.ProfileEntities
                        where profile.ApplicationId2 == queryEntity.ApplicationId &&
                        profile.InUser == queryEntity.InUser &&
                        profile.ProfileType == queryEntity.ProfileType
                        select profile;

            List <ProfileEntity> result = query.ToList();

            return(result);
        }
Exemple #3
0
        public static ProfileQueryEntity ToProfileDataQueryEntity(this ProfileQueryMsg contract)
        {
            ProfileQueryEntity entity = null;

            if (contract != null)
            {
                entity = new ProfileQueryEntity
                {
                    ApplicationId = contract.ApplicationId,
                    ProfileType   = contract.ProfileType,
                    InUser        = contract.InUser,
                };
            }

            return(entity);
        }