Advertisement
uniblab

Untitled

Jun 14th, 2018
334
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.41 KB | None | 0 0
  1. using System.Linq;
  2.  
  3. namespace Johnson.FacStaffList {
  4.  
  5.     public sealed class PersonToRecord : Icod.Wod.Map.IMapWith {
  6.  
  7.         public PersonToRecord() : base() {
  8.         }
  9.  
  10.  
  11.         System.Collections.Generic.IEnumerable<System.Object> Icod.Wod.Map.IMapWith.ExecuteMap( System.Object obj ) {
  12.             return this.ExecuteMap( obj as System.Collections.Generic.IEnumerable<Person> );
  13.         }
  14.         public System.Collections.Generic.IEnumerable<System.Object> ExecuteMap( System.Collections.Generic.IEnumerable<Person> collection ) {
  15.             if ( ( null == collection ) || !collection.Any() ) {
  16.                 throw new System.ArgumentNullException( "collection" );
  17.             }
  18.             return collection.SelectMany(
  19.                 x => x.jobs ?? new Job[ 0 ],
  20.                 ( person, job ) => new {
  21.                     person,
  22.                     job = job ?? new Job()
  23.                 }
  24.             ).Select(
  25.                 x => new {
  26.                     x.person.netid,
  27.                     x.person.fname,
  28.                     x.person.mname,
  29.                     x.person.lname,
  30.                     x.job.title_work,
  31.                     x.person.emplid,
  32.                     x.person.salutation,
  33.                     x.person.suffix,
  34.                     primary_job = ( 0 != ( x.job.primary_job ?? 0 ) ),
  35.                     x.job.manager_emplid,
  36.  
  37.                     x.person.work_phone,
  38.                     x.person.work_address_1,
  39.                     x.person.work_address_2,
  40.                     x.person.work_city,
  41.                     x.person.work_state,
  42.                     x.person.work_postal,
  43.                     work_address_visibility = ( 0 != ( x.person.work_address_visibility ?? 0 ) ),
  44.  
  45.                     x.job.title_univ,
  46.                     x.job.job_family_id,
  47.                     x.job.supervisory_org
  48.                 }
  49.             );
  50.         }
  51.  
  52.     }
  53.  
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement