hi experts,
1) https://embed.plnkr.co/plunk/7ubJ3l .. that link is not showing for full code
so i m asking expert
here is code employyee sservice.ts.
DeleteEmployee(id) {
return this._http.delete(
'http://localhost:52467/Employee/Delete/' + id
);
}
ShowEmployee(id): Observable<Employee> {
return this._http
.get('http://localhost:52467/Employee/GetEmployee/' + id)
.map((response: Response) => <Employee>response.json());
}
as Above i cant found link like this
,http://localhost:52467/Employee/Delete/,get('http://localhost:52467/Employee/GetEmployee/
from where i got these link n what is code in these code ?
is this for vss code?? or is this for visual studio ? any idea for what to do for process of service/mvc?
2) i found another link http://www.advancesharp.com/blog/1215/angular-2-crud-with-web-api-2
here is code webapi method
- [HttpPost]
- [Route("api/Customer/SaveCustomer")]
- public IHttpActionResult SaveCustomer(Customer customer)
- {
- if (customer.Id > 0)
- {
- var dbCustomer = db.Customers.FirstOrDefault(x=>x.Id == customer.Id);
- dbCustomer.Name = customer.Name;
- dbCustomer.Address = customer.Address;
- dbCustomer.Phone = customer.Phone;
- db.SaveChanges();
- }
- else
- {
- db.Customers.Add(customer);
- db.SaveChanges();
- }
- return Ok(customer.Id);
- }
is this webapi for visual studio ?
that link is saying it is for vs code only .. is it true? or can i use both vscode or vs ?
i cant do anything without www.c-sharpcorner.com. so i need help for step to step demo source code