This commit is contained in:
@@ -17,16 +17,12 @@ public class ObjectController : ControllerBase
|
||||
|
||||
//=========================== GET =================================//
|
||||
[HttpGet("GetObject")]
|
||||
[ProducesResponseType<List<ObjectItem>>(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||
public IActionResult GetList()
|
||||
{
|
||||
using (var db = new SQLiteService())
|
||||
{
|
||||
var oi = db.ObjectItems.ToList();
|
||||
//if (oi.Count != 0)
|
||||
return Ok(oi);
|
||||
//else return NoContent();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +61,7 @@ public class ObjectController : ControllerBase
|
||||
{
|
||||
using (var db = new SQLiteService())
|
||||
{
|
||||
db.ObjectItems.Add(o);//.Where(u => u.Name == name).FirstOrDefault();
|
||||
db.ObjectItems.Add(o);
|
||||
db.SaveChanges();
|
||||
return Created();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user