public static CompanyModel toModel(Company entity)
        {
            CompanyModel model = new CompanyModel();

            if (entity != null)
            {
                model.token       = entity.token;
                model.CompanyName = entity.CompanyName;
                model.Departments = entity.Departments.Select(a => DepartmentMapper.toModel(a)).ToList();
            }
            return(model);
        }
        public static Company toEntity(Company entity, CompanyModel model)
        {
            if (model != null)
            {
                entity.token       = model.token;
                entity.CompanyName = model.CompanyName;
                entity.Departments = DepartmentMapper.toEntity(entity.Departments, model.Departments);
            }
            else
            {
                entity = new Company();
            }

            return(entity);
        }
        public static EmployeeModel toModel(Employee entity)
        {
            EmployeeModel model = new EmployeeModel();

            if (entity != null)
            {
                model.token          = entity.token;
                model.FirstName      = entity.FirstName;
                model.LastName       = entity.LastName;
                model.JobTitle       = entity.JobTitle;
                model.MailingAddress = entity.MailingAddress;
                model.company        = CompanyMapper.toModel(entity.company);
                model.department     = DepartmentMapper.toModel(entity.department);
            }
            return(model);
        }
        public static Employee toEntity(Employee entity, EmployeeModel model)
        {
            if (model != null)
            {
                entity.token          = model.token;
                entity.FirstName      = model.FirstName;
                entity.LastName       = model.LastName;
                entity.JobTitle       = model.JobTitle;
                entity.MailingAddress = model.MailingAddress;

                entity.departmentToken = model.department.token;
                entity.department      = DepartmentMapper.toEntity(new Department(), model.department);
                entity.companyToken    = model.company.token;
                entity.company         = CompanyMapper.toEntity(new Company(), model.company);
            }
            return(entity);
        }