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); }
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); }
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); }