Click here to Skip to main content
15,881,172 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
public void Put(int id,string name, [FromBody] Employee employee)
{
try
{
using (EmployeeDBContext dBContext = new EmployeeDBContext())
{
var entity = dBContext.Employees.FirstOrDefault(e => e.ID == id );

entity.LastName = employee.LastName;
entity.Gender = employee.Gender;
entity.Salary = employee.Salary;
dBContext.SaveChanges();
}
}
catch(Exception ex)
{

}
}

What I have tried:

public void Put(int id,string name, [FromBody] Employee employee)
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900