title: Image Uploading in Dot net core Web API
body: <p>I'm new to dot net core.
  how can I upload, edit and delete an image into dot net core WEB API?.
  What should I do, step by step to add/edit or delete an image.
  I do not have a wwwroot folder.
  I need to upload an employee profile picture and if I delete an employee, the employee profile picture should also be deleted.</p>
  <p>This is my EmployeeController.cs file</p>
  <pre><code>using System;
  using System.Collections.Generic;
  using System.IO;
  using System.Linq;
  using System.Threading.Tasks;
  using EmployeeWebApi.Models;
  using Microsoft.AspNetCore.Http;
  using Microsoft.AspNetCore.Mvc;
  using Microsoft.EntityFrameworkCore;
  using Microsoft.Extensions.Hosting.Internal;
  
  namespace EmployeeWebApi.Controllers
  {
      [Route(&quot;api/[Controller]&quot;)]
      [ApiController]
      public class EmployeeController:ControllerBase
      {
          private readonly EmployeeDbContext _context; 
          public EmployeeController(EmployeeDbContext context)
          {
              _context = context;
          }
  
          //GET: api/Emplyeee
          [HttpGet]
          public async Task&lt;List&lt;Employee&gt;&gt; GetAllEmployees(){
             
              var employees = await _context.Thanusiga_Employees.ToListAsync();
  
              return employees;
          }
  
          //GET: api/Employee/5
          [HttpGet(&quot;{id}&quot;)]
          public async Task&lt;ActionResult&lt;Employee&gt;&gt; GetEmployee(int id){
              var employee = await _context.Thanusiga_Employees.FindAsync(id);
  
              if( employee == null){
                  return NotFound();
              }
  
              return employee;
          }
  
          //POST: api/Employee
          [HttpPost]
          public async Task&lt;ActionResult&lt;Employee&gt;&gt; PostEmployee(Employee employee){
              _context.Thanusiga_Employees.Add(employee);
              await _context.SaveChangesAsync();
  
              return CreatedAtAction(nameof(GetEmployee), new {id = employee.Id}, employee);
  
          }
  
          //PUT: api/Employee/3
          [HttpPut(&quot;{id}&quot;)]
          public async Task&lt;IActionResult&gt; PutEmployee(int id, Employee employee){
              if(id != employee.Id){
                  return BadRequest();
              }
  
              _context.Entry(employee).State = EntityState.Modified;
  
              try{
                  await _context.SaveChangesAsync();
              }
              catch (DbUpdateConcurrencyException){
                  if(!EmployeeExists(id)){
                      return NotFound();
                  }
                  else{
                      throw;
                  }
              }
              return NoContent();
          }
  
          private bool EmployeeExists(int id)
          {
              throw new NotImplementedException();
          }
  
  
          //DELETE: api/Employee/3
          [HttpDelete(&quot;{id}&quot;)]
          public async Task&lt;ActionResult&lt;Employee&gt;&gt; DeleteEmployee(int id){
              var employee = await _context.Thanusiga_Employees.FindAsync(id);
              if(employee == null){
                  return NotFound();
              }
              _context.Thanusiga_Employees.Remove(employee);
              await _context.SaveChangesAsync();
  
              return employee;
          }
  
  
      }
  
  }
  </code></pre>
  <p>Thanks in advance</p>