Пример #1
0
 public void Update(EmployeeOfficePhone employee)
 {
     using (var context = new CodeFirstModels())
     {
         var entity = context.Employees.Where(e => e.EmployeeKey == employee.EmployeeKey).First();
         entity.FirstName = employee.FirstName;
         entity.LastName = employee.LastName;
         entity.OfficePhone = employee.OfficePhone;
         context.SaveChanges();
     }
 }
        public void Update(EmployeeOfficePhone employee)
        {
            const string sql = @"UPDATE	HR.Employee
SET		FirstName = @p0,
		LastName = @p1,
		OfficePhone = @p2
WHERE	EmployeeKey = @p3
";
            using (var context = new CodeFirstModels())
            {
                context.Database.ExecuteSqlCommand(sql, employee.FirstName, employee.LastName, employee.OfficePhone, employee.EmployeeKey);
            }
        }
Пример #3
0
        public void Update(EmployeeOfficePhone employee)
        {
            const string sql = @"UPDATE	HR.Employee
SET		FirstName = @FirstName,
		LastName = @LastName,
		OfficePhone = @OfficePhone
WHERE	EmployeeKey = @EmployeeKey
";
            using (var con = new SqlConnection(m_ConnectionString))
            {
                con.Open();
                con.Execute(sql, employee);
            }
        }
Пример #4
0
 public void Update(EmployeeOfficePhone employee)
 {
     m_DataSource.Update(TableName, employee).Execute();
 }