Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Linq;
- namespace Johnson.FacStaffList {
- public sealed class PersonToRecord : Icod.Wod.Map.IMapWith {
- public PersonToRecord() : base() {
- }
- System.Collections.Generic.IEnumerable<System.Object> Icod.Wod.Map.IMapWith.ExecuteMap( System.Object obj ) {
- return this.ExecuteMap( obj as System.Collections.Generic.IEnumerable<Person> );
- }
- public System.Collections.Generic.IEnumerable<System.Object> ExecuteMap( System.Collections.Generic.IEnumerable<Person> collection ) {
- if ( ( null == collection ) || !collection.Any() ) {
- throw new System.ArgumentNullException( "collection" );
- }
- return collection.SelectMany(
- x => x.jobs ?? new Job[ 0 ],
- ( person, job ) => new {
- person,
- job = job ?? new Job()
- }
- ).Select(
- x => new {
- x.person.netid,
- x.person.fname,
- x.person.mname,
- x.person.lname,
- x.job.title_work,
- x.person.emplid,
- x.person.salutation,
- x.person.suffix,
- primary_job = ( 0 != ( x.job.primary_job ?? 0 ) ),
- x.job.manager_emplid,
- x.person.work_phone,
- x.person.work_address_1,
- x.person.work_address_2,
- x.person.work_city,
- x.person.work_state,
- x.person.work_postal,
- work_address_visibility = ( 0 != ( x.person.work_address_visibility ?? 0 ) ),
- x.job.title_univ,
- x.job.job_family_id,
- x.job.supervisory_org
- }
- );
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement