コード例 #1
0
        Contracts.Employee Contracts.ISampleService.SaveEmployeeWithoutContact(Contracts.Employee employee)
        {
            using (var context = new AdventureWorksEntities())
            {
                var employeeEntity = new ReverseMapper(new EntityModelObjectSource(context))
                                     .AllowUpdating <Employee>()
                                     .MapFromEmployee(employee);

                context.SaveChanges();

                return(new Mapper().MapToEmployee(employeeEntity));
            }
        }
コード例 #2
0
ファイル: Reference.cs プロジェクト: azathoh/trainings
 public System.Threading.Tasks.Task AddEmployeeToCompanyAsync(Contracts.Employee employee, Contracts.Company company)
 {
     return(base.Channel.AddEmployeeToCompanyAsync(employee, company));
 }
コード例 #3
0
ファイル: Reference.cs プロジェクト: azathoh/trainings
 public void AddEmployeeToCompany(Contracts.Employee employee, Contracts.Company company)
 {
     base.Channel.AddEmployeeToCompany(employee, company);
 }
コード例 #4
0
ファイル: Reference.cs プロジェクト: azathoh/trainings
 public System.Threading.Tasks.Task AddEmployeeAsync(Contracts.Employee employee)
 {
     return(base.Channel.AddEmployeeAsync(employee));
 }
コード例 #5
0
ファイル: Reference.cs プロジェクト: azathoh/trainings
 public void AddEmployee(Contracts.Employee employee)
 {
     base.Channel.AddEmployee(employee);
 }
コード例 #6
0
 public Contracts.Employee UpdateEmployee(Contracts.Employee employee)
 {
     Model.Employee efEmployee = _mapper.Map <Contracts.Employee, Model.Employee>(employee);
     _employeeRepository.UpdateEmployee(efEmployee);
     return(employee);
 }
コード例 #7
0
 public Contracts.Employee CreateEmployee(Contracts.Employee employee)
 {
     Model.Employee efEmployee = _mapper.Map <Contracts.Employee, Model.Employee>(employee);
     efEmployee = _employeeRepository.CreateEmployee(efEmployee);
     return(_mapper.Map <Model.Employee, Contracts.Employee>(efEmployee));
 }