public static ProxyEmployee ConvertToOneProxyEmployee(new_employee emp) { ProxyEmployee p = new ProxyEmployee(); p.BirthDate = emp.new_birthdate; p.Name = emp.new_name; p.ID = emp.Id; return(p); }
public ProxyEmployee GetOneEmployee(Guid id) { ProxyEmployee covenant = null; //using (Xrm.XrmServiceContext context = new Xrm.XrmServiceContext("Xrm")) //{ var c = this.context.new_employeeSet.Where(i => i.Id == id).FirstOrDefault(); if (c != null) { covenant = ObjectConverter.ConvertToOneProxyEmployee(c); } //} return(covenant); }
public static List <ProxyEmployee> ConvertToProxyEmployee(List <new_employee> emps, OrgContext context) { List <ProxyEmployee> list = new List <ProxyEmployee>(); foreach (var emp in emps) { ProxyEmployee p = new ProxyEmployee(); p.BirthDate = emp.new_birthdate; p.Name = emp.new_name; p.ID = emp.Id; list.Add(p); } return(list); }