添加项目文件。

This commit is contained in:
luoyunchong
2020-08-09 14:50:47 +08:00
parent 5d21b53ae2
commit 483c410943
51 changed files with 2367 additions and 0 deletions

View File

@ -0,0 +1,50 @@
using System.Collections.Generic;
using Microsoft.AspNetCore.Mvc;
namespace Basic.Controllers
{
[Route("/stores")]
[Produces("application/json")]
public class UnboundParamsController
{
[HttpPost]
public int Create(Store store)
{
return 1;
}
[HttpGet]
public IEnumerable<Store> Search(string[] locations = null)
{
return new[]
{
new Store { Id = 1, Location = "Boston" },
new Store { Id = 1, Location = "Seattle" }
};
}
[HttpGet("{id}")]
public Store GetById(int id)
{
return new Store { Id = 1, Location = "Boston" };
}
[HttpPut("{id}")]
public void Update(int id, Store store)
{
}
[HttpDelete("{id}")]
public void Delete(int id)
{
}
}
public class Store
{
public int Id { get; set; }
public string Location { get; set; }
}
}