-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Yusuf Enes Aras
committed
Aug 6, 2021
1 parent
c3cdb21
commit ca85a32
Showing
102 changed files
with
13,202 additions
and
1 deletion.
There are no files selected for viewing
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
using Business.Abstract; | ||
using Entities.Concrete; | ||
using Microsoft.AspNetCore.Http; | ||
using Microsoft.AspNetCore.Mvc; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
|
||
namespace WebAPI.Controllers | ||
{ | ||
[Route("api/[controller]")] | ||
[ApiController] | ||
public class BrandsController : ControllerBase | ||
{ | ||
private IBrandService _brandService; | ||
public BrandsController(IBrandService brandService) | ||
{ | ||
_brandService = brandService; | ||
} | ||
|
||
[HttpPost("add")] | ||
public IActionResult Add(Brand brand) | ||
{ | ||
var result = _brandService.Add(brand); | ||
if (result.Success) | ||
{ | ||
return Ok(result); | ||
} | ||
return BadRequest(result); | ||
} | ||
[HttpPost("delete")] | ||
public IActionResult Delete(Brand brand) | ||
{ | ||
var result = _brandService.Delete(brand); | ||
if (result.Success) | ||
{ | ||
return Ok(result); | ||
} | ||
return BadRequest(result.Message); | ||
} | ||
|
||
[HttpPost("update")] | ||
public IActionResult Update(Brand brand) | ||
{ | ||
var result = _brandService.Update(brand); | ||
if (result.Success) | ||
{ | ||
return Ok(result); | ||
} | ||
return BadRequest(result.Message); | ||
} | ||
[HttpGet("getall")] | ||
public IActionResult GetAll() | ||
{ | ||
var result = _brandService.GetAll(); | ||
if (result.Success) | ||
{ | ||
return Ok(result.Data); | ||
} | ||
return BadRequest(result.Message); | ||
} | ||
|
||
[HttpGet("getbyid")] | ||
public IActionResult GetById(int id) | ||
{ | ||
var result = _brandService.GetById(id); | ||
if (result.Success) | ||
{ | ||
return Ok(result.Data); | ||
} | ||
return BadRequest(result.Message); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
using Business.Abstract; | ||
using Business.Concrete; | ||
using DataAccess.Concrete.EntityFramework; | ||
using Entities.Concrete; | ||
using Microsoft.AspNetCore.Http; | ||
using Microsoft.AspNetCore.Mvc; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
|
||
namespace WebAPI.Controllers | ||
{ | ||
[Route("api/[controller]")] | ||
[ApiController] // attribute | ||
public class CarsController : ControllerBase | ||
{ | ||
//Ioc Container -- Inversion of Control | ||
ICarService _carService; | ||
|
||
public CarsController(ICarService carService) | ||
{ | ||
_carService = carService; | ||
} | ||
|
||
[HttpGet("getall")] | ||
public IActionResult GetAll() | ||
{ | ||
|
||
var result = _carService.GetAll(); | ||
if (result.Success) | ||
{ | ||
return Ok(result); | ||
} | ||
return BadRequest(result); | ||
} | ||
|
||
[HttpPost("add")] | ||
public IActionResult Add(Car car) | ||
{ | ||
var result = _carService.Add(car); | ||
if (result.Success) | ||
{ | ||
return Ok(result); | ||
} | ||
return BadRequest(result); | ||
} | ||
[HttpGet("getbyid")] | ||
public IActionResult GetById(int id) | ||
{ | ||
var result = _carService.GetById(id); | ||
if (result.Success) | ||
{ | ||
return Ok(result.Data); | ||
} | ||
return BadRequest(result); | ||
} | ||
[HttpPost("delete")] | ||
public IActionResult Delete(Car car) | ||
{ | ||
var result = _carService.Delete(car); | ||
if (result.Success) | ||
{ | ||
return Ok(result); | ||
} | ||
return BadRequest(result.Message); | ||
} | ||
|
||
[HttpPost("update")] | ||
public IActionResult Update(Car car) | ||
{ | ||
var result = _carService.Update(car); | ||
if (result.Success) | ||
{ | ||
return Ok(result); | ||
} | ||
return BadRequest(result.Message); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
using Business.Abstract; | ||
using Entities.Concrete; | ||
using Microsoft.AspNetCore.Http; | ||
using Microsoft.AspNetCore.Mvc; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
|
||
namespace WebAPI.Controllers | ||
{ | ||
[Route("api/[controller]")] | ||
[ApiController] | ||
public class ColorsController : ControllerBase | ||
{ | ||
private IColorService _colorService; | ||
|
||
public ColorsController(IColorService colorService) | ||
{ | ||
_colorService = colorService; | ||
} | ||
|
||
[HttpPost("add")] | ||
public IActionResult Add(Color color) | ||
{ | ||
var result = _colorService.Add(color); | ||
if (result.Success) | ||
{ | ||
return Ok(result); | ||
} | ||
return BadRequest(result.Message); | ||
} | ||
|
||
[HttpPost("delete")] | ||
public IActionResult Delete(Color color) | ||
{ | ||
var result = _colorService.Delete(color); | ||
if (result.Success) | ||
{ | ||
return Ok(result); | ||
} | ||
return BadRequest(result.Message); | ||
} | ||
|
||
[HttpPost("update")] | ||
public IActionResult Update(Color color) | ||
{ | ||
var result = _colorService.Update(color); | ||
if (result.Success) | ||
{ | ||
return Ok(result); | ||
} | ||
return BadRequest(result.Message); | ||
} | ||
|
||
[HttpGet("getall")] | ||
public IActionResult GetAll() | ||
{ | ||
var result = _colorService.GetAll(); | ||
if (result.Success) | ||
{ | ||
return Ok(result.Data); | ||
} | ||
return BadRequest(result.Message); | ||
} | ||
|
||
[HttpGet("getbyid")] | ||
public IActionResult GetById(int id) | ||
{ | ||
var result = _colorService.GetById(id); | ||
if (result.Success) | ||
{ | ||
return Ok(result.Data); | ||
} | ||
return BadRequest(result.Message); | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
using Business.Abstract; | ||
using Entities.Concrete; | ||
using Microsoft.AspNetCore.Http; | ||
using Microsoft.AspNetCore.Mvc; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
|
||
namespace WebAPI.Controllers | ||
{ | ||
[Route("api/[controller]")] | ||
[ApiController] | ||
public class CustomersController : ControllerBase | ||
{ | ||
private ICustomerService _customerService; | ||
|
||
public CustomersController(ICustomerService customerService) | ||
{ | ||
_customerService = customerService; | ||
} | ||
|
||
[HttpPost("add")] | ||
public IActionResult Add(Customer customer) | ||
{ | ||
var result = _customerService.Add(customer); | ||
if (result.Success) | ||
{ | ||
return Ok(result); | ||
} | ||
return BadRequest(result.Message); | ||
} | ||
|
||
[HttpPost("delete")] | ||
public IActionResult Delete(Customer customer) | ||
{ | ||
var result = _customerService.Delete(customer); | ||
if (result.Success) | ||
{ | ||
return Ok(result); | ||
} | ||
return BadRequest(result.Message); | ||
} | ||
|
||
[HttpPost("update")] | ||
public IActionResult Update(Customer customer) | ||
{ | ||
var result = _customerService.Update(customer); | ||
if (result.Success) | ||
{ | ||
return Ok(result); | ||
} | ||
return BadRequest(result.Message); | ||
} | ||
|
||
[HttpGet("getall")] | ||
public IActionResult GetAll() | ||
{ | ||
var result = _customerService.GetAll(); | ||
if (result.Success) | ||
{ | ||
return Ok(result.Data); | ||
} | ||
return BadRequest(result.Message); | ||
} | ||
|
||
[HttpGet("getbyid")] | ||
public IActionResult GetById(int id) | ||
{ | ||
var result = _customerService.GetById(id); | ||
if (result.Success) | ||
{ | ||
return Ok(result.Data); | ||
} | ||
return BadRequest(result.Message); | ||
} | ||
} | ||
} |
Oops, something went wrong.