public DimEmployee Create(DimEmployee employeer) { try { if (multiThreaded) { using (AdventureWorksDW2019Entities ctx = new AdventureWorksDW2019Entities()) { ctx.Database.CommandTimeout = TimeOut; return(_CreateEmployeer(employeer, ctx)); } } else { return(_CreateEmployeer(employeer, ctx)); } } catch (EntityCommandExecutionException entityCommandExecutionException) { throw; } DimEmployee _CreateEmployeer(DimEmployee _employeer, AdventureWorksDW2019Entities _ctx) { _ctx.Database.CommandTimeout = TimeOut; _ctx.DimEmployees.Add(_employeer); _ctx.SaveChanges(); return(_employeer); } }
public Task <DimEmployee> Create(DimEmployee employeer) { return(Task <DimEmployee> .Factory.StartNew(() => { return emp.Create(employeer); })); }
public DimEmployee Create(DimEmployee employeer) { return(employeerDAO.Create(employeer)); }