mirror of
https://github.com/chyzy/RSystem-MVC
synced 2024-11-26 08:10:28 +01:00
34 lines
868 B
C#
34 lines
868 B
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Linq;
|
|||
|
using System.Net;
|
|||
|
using System.Net.Http;
|
|||
|
using System.Security.Cryptography.X509Certificates;
|
|||
|
using System.Web.Http;
|
|||
|
using RSystem.DAL;
|
|||
|
|
|||
|
namespace RSystem.Api
|
|||
|
{
|
|||
|
|
|||
|
[Authorize]
|
|||
|
public class SpecializationsController : ApiController
|
|||
|
{
|
|||
|
private ApplicationDbContext db = new ApplicationDbContext();
|
|||
|
|
|||
|
[HttpDelete]
|
|||
|
public IHttpActionResult DeleteMaturaSubejct(int? id)
|
|||
|
{
|
|||
|
if (id == null)
|
|||
|
return BadRequest();
|
|||
|
var toRemove = db.PointsMultipilers.FirstOrDefault(i => i.PointsMultipilerId == id);
|
|||
|
if (toRemove != null)
|
|||
|
{
|
|||
|
db.PointsMultipilers.Remove(toRemove);
|
|||
|
db.SaveChanges();
|
|||
|
return Ok();
|
|||
|
}
|
|||
|
return NotFound();
|
|||
|
}
|
|||
|
}
|
|||
|
}
|