├── .gitignore ├── NuGet.Config ├── README.md ├── Web-Api-Sample.sln ├── global.json └── src └── Web-Api-Sample ├── Controllers └── CustomerController.cs ├── Migrations ├── 20150911070517_go.Designer.cs ├── 20150911070517_go.cs └── WestWindContextModelSnapshot.cs ├── Models ├── Category.cs ├── Customer.cs ├── Employee.cs ├── Order.cs ├── OrderDetail.cs ├── Product.cs ├── Shipper.cs ├── Supplier.cs └── WestWindContext.cs ├── Project_Readme.html ├── Properties └── launchSettings.json ├── Startup.cs ├── Web-Api-Sample.xproj ├── database.sqlite3 ├── hosting.ini ├── project.json └── wwwroot └── web.config /.gitignore: -------------------------------------------------------------------------------- 1 | [Oo]bj/ 2 | [Bb]in/ 3 | .vs/ 4 | *.xap 5 | *.user 6 | /TestResults 7 | *.vspscc 8 | *.vssscc 9 | *.suo 10 | *.cache 11 | *.docstates 12 | _ReSharper.* 13 | *.csproj.user 14 | *[Rr]e[Ss]harper.user 15 | _ReSharper.*/ 16 | packages/* 17 | artifacts/* 18 | msbuild.log 19 | PublishProfiles/ 20 | *.psess 21 | *.vsp 22 | *.pidb 23 | *.userprefs 24 | *DS_Store 25 | *.ncrunchsolution 26 | *.log 27 | *.vspx 28 | /.symbols 29 | nuget.exe 30 | build/ 31 | *net45.csproj 32 | *k10.csproj 33 | App_Data/ 34 | bower_components 35 | node_modules 36 | *.sln.ide 37 | */*.Spa/public/* 38 | */*.Spa/wwwroot/lib 39 | *.ng.ts 40 | *.sln.ide 41 | project.lock.json -------------------------------------------------------------------------------- /NuGet.Config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Web-Api-Sample 2 | 3 | ## Initial setup 4 | 5 | * create an asp.net 5 Web Api project 6 | * Install-Package EntityFramework.SqlServer –Pre 7 | * Install-Package EntityFramework.Sqlite –Pre 8 | * Install-Package EntityFramework.InMemory –Pre 9 | * Install-Package EntityFramework.Commands –Pre 10 | * Install-Package EntityFramework.Core –Pre 11 | * Update project.json 12 | ``` 13 | "commands": { 14 | "web": "Microsoft.AspNet.Hosting --config hosting.ini", 15 | "ef": "EntityFramework.Commands", 16 | "Kestrel": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.Kestrel --server.urls http://localhost:5000" 17 | } 18 | ``` 19 | * use migrations (from command prompt inside project folder src/Web-Api-Sample) 20 | ``` 21 | dnvm use 1.0.0-beta7 22 | dnx ef migrations add MyFirstMigration 23 | dnx ef database update 24 | ``` 25 | 26 | ## Start the api (from command prompt inside project folder src/Web-Api-Sample): 27 | * when running on windows 28 | ``` 29 | dnx web 30 | ``` 31 | * when running on linux 32 | ``` 33 | dnx Kestrel 34 | ``` 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /Web-Api-Sample.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.23107.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{3427C4A3-CDC7-41B8-BCDF-A41955D68C1B}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{0C90E002-A144-4EC2-B118-C4C5813DDE07}" 9 | ProjectSection(SolutionItems) = preProject 10 | global.json = global.json 11 | NuGet.Config = NuGet.Config 12 | README.md = README.md 13 | EndProjectSection 14 | EndProject 15 | Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Web-Api-Sample", "src\Web-Api-Sample\Web-Api-Sample.xproj", "{D33E05D2-F157-4863-B9A0-4E7BEE72C02A}" 16 | EndProject 17 | Global 18 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 19 | Debug|Any CPU = Debug|Any CPU 20 | Release|Any CPU = Release|Any CPU 21 | EndGlobalSection 22 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 23 | {D33E05D2-F157-4863-B9A0-4E7BEE72C02A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 24 | {D33E05D2-F157-4863-B9A0-4E7BEE72C02A}.Debug|Any CPU.Build.0 = Debug|Any CPU 25 | {D33E05D2-F157-4863-B9A0-4E7BEE72C02A}.Release|Any CPU.ActiveCfg = Release|Any CPU 26 | {D33E05D2-F157-4863-B9A0-4E7BEE72C02A}.Release|Any CPU.Build.0 = Release|Any CPU 27 | EndGlobalSection 28 | GlobalSection(SolutionProperties) = preSolution 29 | HideSolutionNode = FALSE 30 | EndGlobalSection 31 | GlobalSection(NestedProjects) = preSolution 32 | {D33E05D2-F157-4863-B9A0-4E7BEE72C02A} = {3427C4A3-CDC7-41B8-BCDF-A41955D68C1B} 33 | EndGlobalSection 34 | EndGlobal 35 | -------------------------------------------------------------------------------- /global.json: -------------------------------------------------------------------------------- 1 | { 2 | "projects": [ "src", "test" ], 3 | "sdk": { 4 | "version": "1.0.0-beta7" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/Web-Api-Sample/Controllers/CustomerController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNet.Mvc; 6 | using Web_Api_Sample.Models; 7 | using Microsoft.Data.Entity; 8 | 9 | namespace Web_Api_Sample.Controllers 10 | { 11 | [Route("api/[controller]")] 12 | public class CustomerController : Controller 13 | { 14 | private readonly WestWindContext _context; 15 | public CustomerController(WestWindContext context) 16 | { 17 | _context = context; 18 | } 19 | 20 | 21 | [HttpGet] 22 | [Route("MimicCustomerImport/{numberOfRecords}")] 23 | public async Task MimicCustomerImport(int numberOfRecords) 24 | { 25 | for (int i = 0; i < numberOfRecords; i++) 26 | { 27 | _context.Customers.Add(new Customer { CompanyName = DateTime.Now.ToString() + " " + i }); 28 | } 29 | await _context.SaveChangesAsync(); 30 | return Redirect("/api/customer"); 31 | } 32 | [HttpGet] 33 | [Route("DeleteAll")] 34 | public async Task DeleteAll() 35 | { 36 | await _context.Customers.ForEachAsync(c => _context.Customers.Remove(c)); 37 | await _context.SaveChangesAsync(); 38 | return Redirect("/api/customer"); 39 | } 40 | 41 | // GET: api/customer 42 | [HttpGet] 43 | public async Task> GetAll() 44 | { 45 | return await _context.Customers.ToListAsync(); 46 | } 47 | 48 | // GET api/customer/5 49 | [HttpGet("{id}")] 50 | public async Task Get(int id) 51 | { 52 | var item = await _context.Customers.FirstOrDefaultAsync(x => x.Id == id); 53 | if (item == null) 54 | { 55 | return HttpNotFound(); 56 | } 57 | return new ObjectResult(item); 58 | } 59 | 60 | // POST api/customer 61 | [HttpPost] 62 | public async Task Post([FromBody]Customer item) 63 | { 64 | if (!ModelState.IsValid) 65 | { 66 | //Context.Response.StatusCode = 400; 67 | return HttpBadRequest(); 68 | } 69 | 70 | else 71 | { 72 | var itemExists = await _context.Customers.AnyAsync(i => i.Id == item.Id); 73 | if (itemExists) 74 | { 75 | return HttpBadRequest(); 76 | } 77 | _context.Customers.Add(item); 78 | await _context.SaveChangesAsync(); 79 | string url = Url.RouteUrl("GetByIdRoute", new { id = item.Id }, Request.Scheme, Request.Host.ToUriComponent()); 80 | Context.Response.StatusCode = 201; 81 | Context.Response.Headers["Location"] = url; 82 | return Ok(); 83 | } 84 | } 85 | 86 | // PUT api/customer/5 87 | [HttpPut("{id}")] 88 | public async Task Put(string id, [FromBody]Customer item) 89 | { 90 | if (item == null) 91 | { 92 | return HttpBadRequest("No item data provided"); 93 | } 94 | var existingItem = await _context.Customers.FirstOrDefaultAsync(i => i.Id == item.Id); 95 | if (existingItem == null) 96 | { 97 | return HttpNotFound("Item not found"); 98 | } 99 | 100 | existingItem.CompanyName = item.CompanyName; 101 | existingItem.Address = item.Address; 102 | existingItem.City = item.City; 103 | existingItem.ContactTitle = item.ContactTitle; 104 | existingItem.Fax = item.Fax; 105 | existingItem.Phone = item.Phone; 106 | existingItem.PostalCode = item.PostalCode; 107 | existingItem.Region = item.Region; 108 | await _context.SaveChangesAsync(); 109 | return Ok(); 110 | } 111 | 112 | // DELETE api/customer/5 113 | [HttpDelete("{id}")] 114 | public async Task Delete(int id) 115 | { 116 | var item = await _context.Customers.FirstOrDefaultAsync(x => x.Id == id); 117 | if (item == null) 118 | { 119 | return HttpNotFound(); 120 | } 121 | _context.Customers.Remove(item); 122 | await _context.SaveChangesAsync(); 123 | return new HttpStatusCodeResult(204); // 201 No Content 124 | } 125 | } 126 | } 127 | -------------------------------------------------------------------------------- /src/Web-Api-Sample/Migrations/20150911070517_go.Designer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.Data.Entity; 3 | using Microsoft.Data.Entity.Infrastructure; 4 | using Microsoft.Data.Entity.Metadata; 5 | using Microsoft.Data.Entity.Migrations; 6 | using Web_Api_Sample.Models; 7 | 8 | namespace WebApiSample.Migrations 9 | { 10 | [DbContext(typeof(WestWindContext))] 11 | partial class go 12 | { 13 | public override string Id 14 | { 15 | get { return "20150911070517_go"; } 16 | } 17 | 18 | protected override void BuildTargetModel(ModelBuilder modelBuilder) 19 | { 20 | modelBuilder 21 | .Annotation("ProductVersion", "7.0.0-beta7-15540"); 22 | 23 | modelBuilder.Entity("Web_Api_Sample.Models.Customer", b => 24 | { 25 | b.Property("Id") 26 | .ValueGeneratedOnAdd(); 27 | 28 | b.Property("Address"); 29 | 30 | b.Property("City"); 31 | 32 | b.Property("CompanyName"); 33 | 34 | b.Property("ContactTitle"); 35 | 36 | b.Property("Fax"); 37 | 38 | b.Property("Phone"); 39 | 40 | b.Property("PostalCode"); 41 | 42 | b.Property("Region"); 43 | 44 | b.Key("Id"); 45 | }); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/Web-Api-Sample/Migrations/20150911070517_go.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Microsoft.Data.Entity.Migrations; 4 | 5 | namespace WebApiSample.Migrations 6 | { 7 | public partial class go : Migration 8 | { 9 | protected override void Up(MigrationBuilder migrationBuilder) 10 | { 11 | migrationBuilder.CreateTable( 12 | name: "Customer", 13 | columns: table => new 14 | { 15 | Id = table.Column(isNullable: false) 16 | .Annotation("Sqlite:Autoincrement", true), 17 | Address = table.Column(isNullable: true), 18 | City = table.Column(isNullable: true), 19 | CompanyName = table.Column(isNullable: true), 20 | ContactTitle = table.Column(isNullable: true), 21 | Fax = table.Column(isNullable: true), 22 | Phone = table.Column(isNullable: true), 23 | PostalCode = table.Column(isNullable: true), 24 | Region = table.Column(isNullable: true) 25 | }, 26 | constraints: table => 27 | { 28 | table.PrimaryKey("PK_Customer", x => x.Id); 29 | }); 30 | } 31 | 32 | protected override void Down(MigrationBuilder migrationBuilder) 33 | { 34 | migrationBuilder.DropTable("Customer"); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Web-Api-Sample/Migrations/WestWindContextModelSnapshot.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.Data.Entity; 3 | using Microsoft.Data.Entity.Infrastructure; 4 | using Microsoft.Data.Entity.Metadata; 5 | using Microsoft.Data.Entity.Migrations; 6 | using Web_Api_Sample.Models; 7 | 8 | namespace WebApiSample.Migrations 9 | { 10 | [DbContext(typeof(WestWindContext))] 11 | partial class WestWindContextModelSnapshot : ModelSnapshot 12 | { 13 | protected override void BuildModel(ModelBuilder modelBuilder) 14 | { 15 | modelBuilder 16 | .Annotation("ProductVersion", "7.0.0-beta7-15540"); 17 | 18 | modelBuilder.Entity("Web_Api_Sample.Models.Customer", b => 19 | { 20 | b.Property("Id") 21 | .ValueGeneratedOnAdd(); 22 | 23 | b.Property("Address"); 24 | 25 | b.Property("City"); 26 | 27 | b.Property("CompanyName"); 28 | 29 | b.Property("ContactTitle"); 30 | 31 | b.Property("Fax"); 32 | 33 | b.Property("Phone"); 34 | 35 | b.Property("PostalCode"); 36 | 37 | b.Property("Region"); 38 | 39 | b.Key("Id"); 40 | }); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/Web-Api-Sample/Models/Category.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace Web_Api_Sample.Models 7 | { 8 | public class Category 9 | { 10 | public int CategoryID { get; set; } 11 | public string CategoryName { get; set; } 12 | public string Description { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/Web-Api-Sample/Models/Customer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace Web_Api_Sample.Models 7 | { 8 | public class Customer 9 | { 10 | public int Id { get; set; } 11 | public string CompanyName { get; set; } 12 | public string ContactTitle { get; set; } 13 | public string Address { get; set; } 14 | public string City { get; set; } 15 | public string Region { get; set; } 16 | public string PostalCode { get; set; } 17 | public string Phone { get; set; } 18 | public string Fax { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Web-Api-Sample/Models/Employee.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace Web_Api_Sample.Models 7 | { 8 | public class Employee 9 | { 10 | public int EmployeeId { get; set; } 11 | public string LastName { get; set; } 12 | public string FirstName { get; set; } 13 | public string Title { get; set; } 14 | public string TitleOfCourtesy { get; set; } 15 | public DateTime BirthDate { get; set; } 16 | public DateTime? HireDate { get; set; } 17 | public string Address { get; set; } 18 | public string City { get; set; } 19 | public string Region { get; set; } 20 | public string PostalCode { get; set; } 21 | public string Country { get; set; } 22 | public string HomePhone { get; set; } 23 | public string Extension { get; set; } 24 | public string Notes { get; set; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Web-Api-Sample/Models/Order.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace Web_Api_Sample.Models 7 | { 8 | public class Order 9 | { 10 | public int OrderID { get; set; } 11 | 12 | public string CustomerID { get; set; } 13 | 14 | public int EmployeeID { get; set; } 15 | 16 | public DateTime? OrderDate { get; set; } 17 | 18 | public DateTime? RequiredDate { get; set; } 19 | 20 | public DateTime? ShippedDate { get; set; } 21 | 22 | public int ShipVia { get; set; } 23 | 24 | public decimal Freight { get; set; } 25 | 26 | public string ShipName { get; set; } 27 | 28 | public string ShipAddress { get; set; } 29 | 30 | public string ShipCity { get; set; } 31 | 32 | public string ShipRegion { get; set; } 33 | 34 | public string ShipCountry { get; set; } 35 | 36 | public virtual ICollection OrderDetails { get; set; } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/Web-Api-Sample/Models/OrderDetail.cs: -------------------------------------------------------------------------------- 1 | namespace Web_Api_Sample.Models 2 | { 3 | public class OrderDetail 4 | { 5 | public int OrderID { get; set; } 6 | public int ProductID { get; set; } 7 | public decimal UnitPrice { get; set; } 8 | public int Quantity { get; set; } 9 | public float Discount { get; set; } 10 | // public Order Order { get; set; } ??? 11 | } 12 | } -------------------------------------------------------------------------------- /src/Web-Api-Sample/Models/Product.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace Web_Api_Sample.Models 7 | { 8 | public class Product 9 | { 10 | public int ProductID { get; set; } 11 | public int SupplierID { get; set; } 12 | public int CategoryID { get; set; } 13 | public string ProductName { get; set; } 14 | public string QuantityPerUnit { get; set; } 15 | public decimal UnitPrice { get; set; } 16 | public int UnitsInStock { get; set; } 17 | public int UnitsOnOrder { get; set; } 18 | public int ReorderLevel { get; set; } 19 | public bool Discontinued { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Web-Api-Sample/Models/Shipper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace Web_Api_Sample.Models 7 | { 8 | public class Shipper 9 | { 10 | public int ShipperID { get; set; } 11 | public string CompanyName { get; set; } 12 | public string Phone { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/Web-Api-Sample/Models/Supplier.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace Web_Api_Sample.Models 7 | { 8 | public class Supplier 9 | { 10 | public int SupplierID { get; set; } 11 | public string CompanyName { get; set; } 12 | public string ContactName { get; set; } 13 | public string ContactTitle { get; set; } 14 | public string Address { get; set; } 15 | public string City { get; set; } 16 | public string Region { get; set; } 17 | public string PostalCode { get; set; } 18 | public string Country { get; set; } 19 | public string Phone { get; set; } 20 | public string Fax { get; set; } 21 | public string HomePage { get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Web-Api-Sample/Models/WestWindContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Data.Entity; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace Web_Api_Sample.Models 8 | { 9 | public class WestWindContext: DbContext 10 | { 11 | public DbSet Customers { get; set; } 12 | 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/Web-Api-Sample/Project_Readme.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Welcome to ASP.NET 5 6 | 127 | 128 | 129 | 130 | 150 | 151 |
152 |
153 |

This application consists of:

154 |
    155 |
  • Sample pages using ASP.NET MVC 6
  • 156 |
  • Gulp and Bower for managing client-side resources
  • 157 |
  • Theming using Bootstrap
  • 158 |
159 |
160 | 161 | 172 | 173 | 185 | 186 | 196 | 197 | 200 |
201 | 202 | 203 | 204 | -------------------------------------------------------------------------------- /src/Web-Api-Sample/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "IIS Express": { 4 | "commandName" : "IISExpress", 5 | "launchBrowser": true, 6 | "launchUrl": "api/customer", 7 | "environmentVariables" : { 8 | "ASPNET_ENV": "Development" 9 | } 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Web-Api-Sample/Startup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNet.Builder; 6 | using Microsoft.AspNet.Hosting; 7 | using Microsoft.Framework.DependencyInjection; 8 | using Microsoft.Data.Entity; 9 | using Web_Api_Sample.Models; 10 | using Microsoft.Dnx.Runtime; 11 | using Microsoft.Dnx.Runtime.Infrastructure; 12 | using Swashbuckle.Application; 13 | using Swashbuckle.Swagger.Annotations; 14 | using Swashbuckle.Swagger.XmlComments; 15 | 16 | 17 | namespace Web_Api_Sample 18 | { 19 | public class Startup 20 | { 21 | public Startup(IHostingEnvironment env) 22 | { 23 | } 24 | 25 | public void ConfigureServices(IServiceCollection services) 26 | { 27 | var appEnv = CallContextServiceLocator.Locator.ServiceProvider.GetRequiredService(); 28 | var databaseName = "database.sqlite3"; 29 | var connection = $"Data Source={ appEnv.ApplicationBasePath}/{databaseName}"; 30 | 31 | services 32 | .AddEntityFramework() 33 | .AddSqlite() 34 | 35 | .AddDbContext(options => options.UseSqlite(connection)); 36 | services //no idea want this line can't be added to previous ?? 37 | .AddMvc() 38 | .AddJsonOptions(options => 39 | { 40 | //elegant handling of circular references 41 | options.SerializerSettings.PreserveReferencesHandling = Newtonsoft.Json.PreserveReferencesHandling.All; 42 | }); 43 | services.AddSwagger(); 44 | } 45 | 46 | public void Configure(IApplicationBuilder app, IHostingEnvironment env) 47 | { 48 | app.UseStaticFiles(); 49 | app.UseMvc(); 50 | app.UseSwagger(); 51 | app.UseSwaggerUi(); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/Web-Api-Sample/Web-Api-Sample.xproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 14.0 5 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) 6 | 7 | 8 | 9 | d33e05d2-f157-4863-b9a0-4e7bee72c02a 10 | Web_Api_Sample 11 | ..\..\artifacts\obj\$(MSBuildProjectName) 12 | ..\..\artifacts\bin\$(MSBuildProjectName)\ 13 | 14 | 15 | 2.0 16 | 52939 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/Web-Api-Sample/database.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paulvanbladel/AspNet5-Web-Api-Sample/a477a99de4fe9a049d11b986530ea158393ff5d2/src/Web-Api-Sample/database.sqlite3 -------------------------------------------------------------------------------- /src/Web-Api-Sample/hosting.ini: -------------------------------------------------------------------------------- 1 | server=Microsoft.AspNet.Server.WebListener 2 | server.urls=http://localhost:5000 3 | -------------------------------------------------------------------------------- /src/Web-Api-Sample/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "webroot": "wwwroot", 3 | "version": "1.0.0-*", 4 | 5 | "dependencies": { 6 | "EntityFramework.Commands": "7.0.0-beta7", 7 | "EntityFramework.Core": "7.0.0-beta7", 8 | "EntityFramework.InMemory": "7.0.0-beta7", 9 | "EntityFramework.Sqlite": "7.0.0-beta7", 10 | "EntityFramework.SqlServer": "7.0.0-beta7", 11 | "Microsoft.AspNet.Mvc": "6.0.0-beta7", 12 | "Microsoft.AspNet.Server.IIS": "1.0.0-beta7", 13 | "Microsoft.AspNet.Server.Kestrel": "1.0.0-beta7", 14 | "Microsoft.AspNet.Server.WebListener": "1.0.0-beta7", 15 | "Microsoft.AspNet.StaticFiles": "1.0.0-beta7", 16 | "Swashbuckle": "6.0.0-beta6" 17 | 18 | }, 19 | 20 | "commands": { 21 | "web": "Microsoft.AspNet.Hosting --config hosting.ini", 22 | "ef": "EntityFramework.Commands", 23 | "Kestrel": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.Kestrel --server.urls http://localhost:5000" 24 | }, 25 | 26 | "frameworks": { 27 | "dnx451": { 28 | "frameworkAssemblies": { 29 | } 30 | }, 31 | "dnxcore50": { } 32 | }, 33 | 34 | "exclude": [ 35 | "wwwroot", 36 | "node_modules", 37 | "bower_components" 38 | ], 39 | "publishExclude": [ 40 | "node_modules", 41 | "bower_components", 42 | "**.xproj", 43 | "**.user", 44 | "**.vspscc" 45 | ] 46 | } 47 | -------------------------------------------------------------------------------- /src/Web-Api-Sample/wwwroot/web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | --------------------------------------------------------------------------------