Subject | Hash | Author | Date (UTC) |
---|---|---|---|
Add DbContext | 63523201e374cd186a873d405395cec6eefd989d | Antonio Calatayud | 2018-11-13 11:13:33 |
Add models | 10cb5370ddb34a9afdaa0ae964c2ee540821462b | Antonio Calatayud | 2018-11-09 18:11:22 |
First commit | 3033c730b731b08ad5198975d238635007575714 | Antonio Calatayud | 2018-11-09 17:09:28 |
File | Lines added | Lines deleted |
---|---|---|
Persistence/VegaDbContext.cs | 18 | 0 |
Startup.cs | 5 | 0 |
appsettings.json | 4 | 1 |
vega.csproj | 1 | 1 |
File Persistence/VegaDbContext.cs added (mode: 100644) (index 0000000..ef48bc5) | |||
1 | using Microsoft.EntityFrameworkCore; | ||
2 | using vega.Models; | ||
3 | using vega.Persistence; | ||
4 | |||
5 | namespace vega.Persistence | ||
6 | { | ||
7 | public class VegaDbContext : DbContext | ||
8 | { | ||
9 | public VegaDbContext( | ||
10 | DbContextOptions<VegaDbContext> options) | ||
11 | : base (options) | ||
12 | { | ||
13 | |||
14 | } | ||
15 | |||
16 | public DbSet<Make> Makes { get; set; } | ||
17 | } | ||
18 | } |
File Startup.cs changed (mode: 100644) (index 63014c6..c89c247) | |||
... | ... | using Microsoft.AspNetCore.Mvc; | |
5 | 5 | using Microsoft.AspNetCore.SpaServices.AngularCli; | using Microsoft.AspNetCore.SpaServices.AngularCli; |
6 | 6 | using Microsoft.Extensions.Configuration; | using Microsoft.Extensions.Configuration; |
7 | 7 | using Microsoft.Extensions.DependencyInjection; | using Microsoft.Extensions.DependencyInjection; |
8 | using Microsoft.EntityFrameworkCore; | ||
9 | using vega.Persistence; | ||
8 | 10 | ||
9 | 11 | namespace vega | namespace vega |
10 | 12 | { | { |
... | ... | namespace vega | |
22 | 24 | { | { |
23 | 25 | services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); | services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); |
24 | 26 | ||
27 | services.AddDbContext<VegaDbContext>(options => | ||
28 | options.UseSqlServer(Configuration.GetConnectionString("Default"))); | ||
29 | |||
25 | 30 | // In production, the Angular files will be served from this directory | // In production, the Angular files will be served from this directory |
26 | 31 | services.AddSpaStaticFiles(configuration => | services.AddSpaStaticFiles(configuration => |
27 | 32 | { | { |
File appsettings.json changed (mode: 100644) (index 7376aad..e854f84) | |||
4 | 4 | "Default": "Warning" | "Default": "Warning" |
5 | 5 | } | } |
6 | 6 | }, | }, |
7 | "AllowedHosts": "*" | ||
7 | "AllowedHosts": "*", | ||
8 | "ConnectionStrings": { | ||
9 | "Default": "server=127.0.0.1,1433; database=Vega; user id=SA; password=SqlServer19H@kle86" | ||
10 | } | ||
8 | 11 | } | } |
File vega.csproj changed (mode: 100644) (index 0c764ff..6aa0993) | |||
18 | 18 | <PackageReference Include="Microsoft.AspNetCore.App" /> | <PackageReference Include="Microsoft.AspNetCore.App" /> |
19 | 19 | <PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.1.2" PrivateAssets="All" /> | <PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.1.2" PrivateAssets="All" /> |
20 | 20 | <PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="2.1.1" /> | <PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="2.1.1" /> |
21 | <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.1.4" /> | ||
21 | 22 | <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.1.4" /> | <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.1.4" /> |
22 | <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.1.4" /> | ||
23 | 23 | </ItemGroup> | </ItemGroup> |
24 | 24 | ||
25 | 25 | <ItemGroup> | <ItemGroup> |