예제 #1
0
        public static IPropertyMappingService ConfigCompanyPropertyMappings(
            this IPropertyMappingService propertyMappingService)
        {
            var propertyMapping = new PropertyMapping <CompanyDTO, Company>(new Dictionary <string, PropertyMappingValue>
            {
                { nameof(CompanyDTO.Id).ToLower(), new PropertyMappingValue(new [] { nameof(Company.Id) }) },
                { nameof(CompanyDTO.Name).ToLower(), new PropertyMappingValue(new [] { nameof(Company.Name) }) },
            });

            propertyMappingService.AddPropertyMapping(propertyMapping);
            return(propertyMappingService);
        }
예제 #2
0
        public static IPropertyMappingService ConfigEmployeePropertyMappings(
            this IPropertyMappingService propertyMappingService)
        {
            var propertyMapping = new PropertyMapping <EmployeeDTO, Employee>(new Dictionary <string, PropertyMappingValue>
            {
                { nameof(EmployeeDTO.Id).ToLower(), new PropertyMappingValue(new [] { nameof(Employee.Id) }) },
                { nameof(EmployeeDTO.CompanyId).ToLower(), new PropertyMappingValue(new [] { nameof(Employee.CompanyId) }) },
                { nameof(EmployeeDTO.EmployeeNo).ToLower(), new PropertyMappingValue(new [] { nameof(Employee.EmployeeNo) }) },
                { nameof(EmployeeDTO.Name).ToLower(), new PropertyMappingValue(new [] { nameof(Employee.FirstName), nameof(Employee.LastName) }) },
                { nameof(EmployeeDTO.GenderDisplay).ToLower(), new PropertyMappingValue(new [] { nameof(Employee.Gender) }) },
                { nameof(EmployeeDTO.Age).ToLower(), new PropertyMappingValue(new [] { nameof(Employee.DateOfBirth) }, true) },
            });

            propertyMappingService.AddPropertyMapping(propertyMapping);
            return(propertyMappingService);
        }