OK , Database added
This commit is contained in:
@ -49,7 +49,7 @@ namespace Vidly.Controllers
|
||||
return View(cust);
|
||||
}
|
||||
}
|
||||
return View(new Customer { Name="",Id=0});
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
public ActionResult Movies()
|
||||
|
||||
29
Vidly/Migrations/201901172234070_InitialModel.Designer.cs
generated
Normal file
29
Vidly/Migrations/201901172234070_InitialModel.Designer.cs
generated
Normal file
@ -0,0 +1,29 @@
|
||||
// <auto-generated />
|
||||
namespace Vidly.Migrations
|
||||
{
|
||||
using System.CodeDom.Compiler;
|
||||
using System.Data.Entity.Migrations;
|
||||
using System.Data.Entity.Migrations.Infrastructure;
|
||||
using System.Resources;
|
||||
|
||||
[GeneratedCode("EntityFramework.Migrations", "6.2.0-61023")]
|
||||
public sealed partial class InitialModel : IMigrationMetadata
|
||||
{
|
||||
private readonly ResourceManager Resources = new ResourceManager(typeof(InitialModel));
|
||||
|
||||
string IMigrationMetadata.Id
|
||||
{
|
||||
get { return "201901172234070_InitialModel"; }
|
||||
}
|
||||
|
||||
string IMigrationMetadata.Source
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
string IMigrationMetadata.Target
|
||||
{
|
||||
get { return Resources.GetString("Target"); }
|
||||
}
|
||||
}
|
||||
}
|
||||
109
Vidly/Migrations/201901172234070_InitialModel.cs
Normal file
109
Vidly/Migrations/201901172234070_InitialModel.cs
Normal file
@ -0,0 +1,109 @@
|
||||
namespace Vidly.Migrations
|
||||
{
|
||||
using System;
|
||||
using System.Data.Entity.Migrations;
|
||||
|
||||
public partial class InitialModel : DbMigration
|
||||
{
|
||||
public override void Up()
|
||||
{
|
||||
CreateTable(
|
||||
"dbo.Customers",
|
||||
c => new
|
||||
{
|
||||
Id = c.Int(nullable: false, identity: true),
|
||||
Name = c.String(),
|
||||
})
|
||||
.PrimaryKey(t => t.Id);
|
||||
|
||||
CreateTable(
|
||||
"dbo.AspNetRoles",
|
||||
c => new
|
||||
{
|
||||
Id = c.String(nullable: false, maxLength: 128),
|
||||
Name = c.String(nullable: false, maxLength: 256),
|
||||
})
|
||||
.PrimaryKey(t => t.Id)
|
||||
.Index(t => t.Name, unique: true, name: "RoleNameIndex");
|
||||
|
||||
CreateTable(
|
||||
"dbo.AspNetUserRoles",
|
||||
c => new
|
||||
{
|
||||
UserId = c.String(nullable: false, maxLength: 128),
|
||||
RoleId = c.String(nullable: false, maxLength: 128),
|
||||
})
|
||||
.PrimaryKey(t => new { t.UserId, t.RoleId })
|
||||
.ForeignKey("dbo.AspNetRoles", t => t.RoleId, cascadeDelete: true)
|
||||
.ForeignKey("dbo.AspNetUsers", t => t.UserId, cascadeDelete: true)
|
||||
.Index(t => t.UserId)
|
||||
.Index(t => t.RoleId);
|
||||
|
||||
CreateTable(
|
||||
"dbo.AspNetUsers",
|
||||
c => new
|
||||
{
|
||||
Id = c.String(nullable: false, maxLength: 128),
|
||||
Email = c.String(maxLength: 256),
|
||||
EmailConfirmed = c.Boolean(nullable: false),
|
||||
PasswordHash = c.String(),
|
||||
SecurityStamp = c.String(),
|
||||
PhoneNumber = c.String(),
|
||||
PhoneNumberConfirmed = c.Boolean(nullable: false),
|
||||
TwoFactorEnabled = c.Boolean(nullable: false),
|
||||
LockoutEndDateUtc = c.DateTime(),
|
||||
LockoutEnabled = c.Boolean(nullable: false),
|
||||
AccessFailedCount = c.Int(nullable: false),
|
||||
UserName = c.String(nullable: false, maxLength: 256),
|
||||
})
|
||||
.PrimaryKey(t => t.Id)
|
||||
.Index(t => t.UserName, unique: true, name: "UserNameIndex");
|
||||
|
||||
CreateTable(
|
||||
"dbo.AspNetUserClaims",
|
||||
c => new
|
||||
{
|
||||
Id = c.Int(nullable: false, identity: true),
|
||||
UserId = c.String(nullable: false, maxLength: 128),
|
||||
ClaimType = c.String(),
|
||||
ClaimValue = c.String(),
|
||||
})
|
||||
.PrimaryKey(t => t.Id)
|
||||
.ForeignKey("dbo.AspNetUsers", t => t.UserId, cascadeDelete: true)
|
||||
.Index(t => t.UserId);
|
||||
|
||||
CreateTable(
|
||||
"dbo.AspNetUserLogins",
|
||||
c => new
|
||||
{
|
||||
LoginProvider = c.String(nullable: false, maxLength: 128),
|
||||
ProviderKey = c.String(nullable: false, maxLength: 128),
|
||||
UserId = c.String(nullable: false, maxLength: 128),
|
||||
})
|
||||
.PrimaryKey(t => new { t.LoginProvider, t.ProviderKey, t.UserId })
|
||||
.ForeignKey("dbo.AspNetUsers", t => t.UserId, cascadeDelete: true)
|
||||
.Index(t => t.UserId);
|
||||
|
||||
}
|
||||
|
||||
public override void Down()
|
||||
{
|
||||
DropForeignKey("dbo.AspNetUserRoles", "UserId", "dbo.AspNetUsers");
|
||||
DropForeignKey("dbo.AspNetUserLogins", "UserId", "dbo.AspNetUsers");
|
||||
DropForeignKey("dbo.AspNetUserClaims", "UserId", "dbo.AspNetUsers");
|
||||
DropForeignKey("dbo.AspNetUserRoles", "RoleId", "dbo.AspNetRoles");
|
||||
DropIndex("dbo.AspNetUserLogins", new[] { "UserId" });
|
||||
DropIndex("dbo.AspNetUserClaims", new[] { "UserId" });
|
||||
DropIndex("dbo.AspNetUsers", "UserNameIndex");
|
||||
DropIndex("dbo.AspNetUserRoles", new[] { "RoleId" });
|
||||
DropIndex("dbo.AspNetUserRoles", new[] { "UserId" });
|
||||
DropIndex("dbo.AspNetRoles", "RoleNameIndex");
|
||||
DropTable("dbo.AspNetUserLogins");
|
||||
DropTable("dbo.AspNetUserClaims");
|
||||
DropTable("dbo.AspNetUsers");
|
||||
DropTable("dbo.AspNetUserRoles");
|
||||
DropTable("dbo.AspNetRoles");
|
||||
DropTable("dbo.Customers");
|
||||
}
|
||||
}
|
||||
}
|
||||
126
Vidly/Migrations/201901172234070_InitialModel.resx
Normal file
126
Vidly/Migrations/201901172234070_InitialModel.resx
Normal file
@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="Target" xml:space="preserve">
|
||||
<value>H4sIAAAAAAAEAOVc227kNhJ9XyD/IOhps3BavmQGs0Z3Aqdt7xoZXzDtGezbgC2x28JIlCJRHhtBviwP+aT8wpISdeFNorrVtwQDDCyxeKpYVSSLpWL/+fsf4x9fwsB6hknqR2hin4yObQsiN/J8tJzYGV58987+8Ydv/jG+8sIX61NJd0bpSE+UTuwnjONzx0ndJxiCdBT6bhKl0QKP3Ch0gBc5p8fH/3ZOThxIIGyCZVnjDxnCfgjzB/I4jZALY5yB4DbyYJCy96RllqNadyCEaQxcOLE/+V7wOirobOsi8AGRYQaDhW0BhCIMMJHw/GMKZziJ0HIWkxcgeHyNIaFbgCCFTPLzmtx0EMendBBO3bGEcrMUR2FPwJMzphVH7L6Sbu1Ka0RvV0S/+JWOOtfdxJ7mLGBiWyKz82mQUEJetaOyw5GVvz6qjE98hP47sqZZgLMEThDMcAKCI+shmwe++zN8fYy+QDRBWRA0h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dmx5rpwyovE+zFqLizsxQeIOoUHcnZhUs7X0Yjzzi/D5Mv8Gq78esIpr2bky+l695M8Z8GSp77nAfUpwsDzZm2q+9SbqAsNZEly8ZbDIqbLtIsF6IcmAF+oNtnYr6+8Gwd+n3Gy+635c6+zpo3215/TYr6lu+tv2lCun3oPRTUYW2+3L5bfuaLlW+5zXH/Yri98zZ2Da/+9L3bTubLp++587Wq8B9z3xtV/vnjj3NeAvdebm6XDQnmlVdh95ahl58mSDH/nlEjF9Eko0CdsNi68I9JDZ8s4pVcVFZXR2pY1b7o5ZhTaJnqi/LFBlLc1PiK1G0s+03VhZTtA6W0bSz1RQzt/FmW0wrb0bTzltTIryLMntlka7q6kPHUtlWvnZIZfXcSDpucXSFxa0lEodURT+IUrjZo/nefzhF84OoZMip06NIXv50T7bnxg/SkhAh9Zc1BP15WgRdbmOuaG7QIirjA0GikkRIAt1CDDyya18k2F8AF5NmmuPOf2khzxvSLy1z6N2g+wzHGSZDhuE84HJqNM5o45/fBOBlHt/H9CkdYghETJ9+G7hHP2V+4FVyXyvSThoIGsCwjDK1JaaZ5eVrhXQXIUMgpr4q7nqEYRwQsPQezcAzXEU24n7v4RK4r3WSUQfSbQhe7eNLHywTEKYMo+5PHokPe+HLD/8HHUOWppdZAAA=</value>
|
||||
</data>
|
||||
<data name="DefaultSchema" xml:space="preserve">
|
||||
<value>dbo</value>
|
||||
</data>
|
||||
</root>
|
||||
23
Vidly/Migrations/Configuration.cs
Normal file
23
Vidly/Migrations/Configuration.cs
Normal file
@ -0,0 +1,23 @@
|
||||
namespace Vidly.Migrations
|
||||
{
|
||||
using System;
|
||||
using System.Data.Entity;
|
||||
using System.Data.Entity.Migrations;
|
||||
using System.Linq;
|
||||
|
||||
internal sealed class Configuration : DbMigrationsConfiguration<Vidly.Models.ApplicationDbContext>
|
||||
{
|
||||
public Configuration()
|
||||
{
|
||||
AutomaticMigrationsEnabled = false;
|
||||
}
|
||||
|
||||
protected override void Seed(Vidly.Models.ApplicationDbContext context)
|
||||
{
|
||||
// This method will be called after migrating to the latest version.
|
||||
|
||||
// You can use the DbSet<T>.AddOrUpdate() helper extension method
|
||||
// to avoid creating duplicate seed data.
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -20,6 +20,8 @@ namespace Vidly.Models
|
||||
|
||||
public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
|
||||
{
|
||||
public DbSet<Customer> Customers { get; set; }
|
||||
|
||||
public ApplicationDbContext()
|
||||
: base("DefaultConnection", throwIfV1Schema: false)
|
||||
{
|
||||
|
||||
@ -181,6 +181,11 @@
|
||||
<Compile Include="Global.asax.cs">
|
||||
<DependentUpon>Global.asax</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Migrations\201901172234070_InitialModel.cs" />
|
||||
<Compile Include="Migrations\201901172234070_InitialModel.Designer.cs">
|
||||
<DependentUpon>201901172234070_InitialModel.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Migrations\Configuration.cs" />
|
||||
<Compile Include="Models\AccountViewModels.cs" />
|
||||
<Compile Include="Models\Customer.cs" />
|
||||
<Compile Include="Models\IdentityModels.cs" />
|
||||
@ -272,6 +277,11 @@
|
||||
<Content Include="Scripts\jquery-3.3.1.slim.min.map" />
|
||||
<Content Include="Scripts\jquery-3.3.1.min.map" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Migrations\201901172234070_InitialModel.resx">
|
||||
<DependentUpon>201901172234070_InitialModel.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
|
||||
Reference in New Issue
Block a user