public Models.Employee AddEmployee(Models.Employee employee) { _dbContext.Users.Add(employee); _dbContext.SaveChanges(); return(employee); //Models.User u = context.Users.Where(x => x.UserId == 6).FirstOrDefault(); //u.CustomFieldValues.Add(new TextCustomField() { CustomFieldId = 100, Value = "test 2" }); //u.CustomFieldValues.Add(new LookupCustomField() { CustomFieldId = 101, LookupValue = 200 }); //context.SaveChanges(); }
static void Main(string[] args) { IEmployeeService svc = new EmployeeService( new EmployeeDataStore( new SQLEmployeeWriteRepo(new IwContext()), new SQLEmployeeReadRepo() )); Models.Employee model = new Models.Employee() { FirstName = "eita", LastName = "porra", Address1 = "address", Address2 = "address2" }; svc.AddEmployee(model); }
public Models.Employee AddEmployee(Models.Employee employee) { return(_dataStore.AddEmployee(employee)); }
public Models.Employee AddEmployee(Models.Employee employee) { return(_writeRepo.AddEmployee(employee)); }