Reading from database

This commit is contained in:
2019-01-19 17:08:56 +01:00
parent 25dc803cfd
commit 19fc2475fa
14 changed files with 607 additions and 13 deletions

View File

@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Entity;
using System.Web.Mvc;
using Vidly.Models;
using Vidly.ViewModels;
@ -11,9 +12,12 @@ namespace Vidly.Controllers
public class CustomersController : Controller
{
List<Customer> customers = null;
private ApplicationDbContext _context;
public CustomersController()
{
_context = new ApplicationDbContext();
customers = new List<Customer>
{
new Customer {Name="Nils Persson", Id=1},
@ -22,6 +26,11 @@ namespace Vidly.Controllers
};
}
protected override void Dispose(bool disposing)
{
_context.Dispose();
}
// GET: Vidly
public ActionResult Index()
{
@ -33,7 +42,7 @@ namespace Vidly.Controllers
var viewModel = new CustomersViewModel()
{
Customers = customers
Customers = _context.Customers.Include(c=>c.MembershipType).ToList()
};
return View(viewModel);
@ -42,14 +51,10 @@ namespace Vidly.Controllers
[Route("Customers/Details/{nr}")]
public ActionResult Customer(int nr)
{
foreach(var cust in customers)
{
if (cust.Id == nr)
{
return View(cust);
}
}
var customer = _context.Customers.SingleOrDefault(c => c.Id == nr);
if (customer== null)
return HttpNotFound();
return View(customer);
}
public ActionResult Movies()

View 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 AddMembershipType : IMigrationMetadata
{
private readonly ResourceManager Resources = new ResourceManager(typeof(AddMembershipType));
string IMigrationMetadata.Id
{
get { return "201901181642319_AddMembershipType"; }
}
string IMigrationMetadata.Source
{
get { return null; }
}
string IMigrationMetadata.Target
{
get { return Resources.GetString("Target"); }
}
}
}

View File

@ -0,0 +1,34 @@
namespace Vidly.Migrations
{
using System;
using System.Data.Entity.Migrations;
public partial class AddMembershipType : DbMigration
{
public override void Up()
{
CreateTable(
"dbo.MembershipTypes",
c => new
{
Id = c.Byte(nullable: false),
SignUpFee = c.Short(nullable: false),
DurationInMonth = c.Byte(nullable: false),
DiscountRate = c.Byte(nullable: false),
})
.PrimaryKey(t => t.Id);
AddColumn("dbo.Customers", "MembershipTypeId", c => c.Byte(nullable: false));
CreateIndex("dbo.Customers", "MembershipTypeId");
AddForeignKey("dbo.Customers", "MembershipTypeId", "dbo.MembershipTypes", "Id", cascadeDelete: true);
}
public override void Down()
{
DropForeignKey("dbo.Customers", "MembershipTypeId", "dbo.MembershipTypes");
DropIndex("dbo.Customers", new[] { "MembershipTypeId" });
DropColumn("dbo.Customers", "MembershipTypeId");
DropTable("dbo.MembershipTypes");
}
}
}

View 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>H4sIAAAAAAAEAOVdW2/juhF+L9D/IOipLXLsXLqLbWCfg6yTtEFzQ5ws+hbQEu0IK1E+EpWNUZxf1of+pP6FkrqZV4mSZdlucYCDWCK/GQ5nyOFwRvuff/179MtH4FvvMIq9EI3tk8GxbUHkhK6HFmM7wfOfvti//Pz7342u3ODD+la0O6PtSE8Uj+03jJfnw2HsvMEAxIPAc6IwDud44ITBELjh8PT4+C/Dk5MhJBA2wbKs0VOCsBfA9Af5OQmRA5c4Af5d6EI/zp+TN9MU1boHAYyXwIFj+5vn+qtB1s62LnwPEB6m0J/bFkAoxAATDs9fYjjFUYgW0yV5APzn1RKSdnPgxzDn/Hzd3HQQx6d0EMN1xwLKSWIcBg0BT85yqQzF7q1ka5dSI3K7IvLFKzrqVHZje5KSgJFticTOJ35EG/KiHRQdjqz08VE5+URH6H9H1iTxcRLBMYIJjoB/ZD0mM99z/g5Xz+F3iMYo8X2WKcIWecc9II8eo3AJI7x6gvOc1RvXtoZ8v6HYsezG9MkGcYPw2alt3RPiYObDcs6ZAU9xGMG/QgQjgKH7CDCGEaIYMJWaRF2gRf9fUCNKRizFtu7Axy1EC/w2tsmftnXtfUC3e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6yvCZKqPJ/Dz1UP6uUelWptgvkGRLHoHkfMGoj8E4OOPLFIXHymYebizDxRgD61SaUi3rjfIhR9j+58pwLl1849XEePIeoiIVp5bx9ZvXRUzVmbG9qAZpTw2Ld6PA+D7bZA09fttGVOV8Jthtavi733GClOTE7s7sN96u6CDpn+lj4+sm/gFeb8m5MUzsXRqF2KhWrcyrygzLxn97SDqt81FTpairCu/AG04/XxVdyNusq4bcNO61vtwrY0rqlaiCtbSvoa6zX6pqp/eaFNX1khvhKiog+4KrxMR6uqc22Bpa5xd8hOnNc7NBquueW7Dmrbeuc1uLVY7my9DRc8d7kOKkMfBOvP7tTdJRaUbGbpcONoArtPi0M1clAMruuxs61TUVHaGvUu9314hpZjduZvKRjmRs2UJZ6t09drMi62VRP4fFD/uS73j+ji42zLHPisbKxIM/qcKGvegBEeRvL/7ssW+dU13O7jntV/NihP3TNlyB3L3JYh9K5vuCnHPla1RoeGe6dqu9s8da5rxFrrzskE5gV6cVnU9YGU5YHYZO7bdWUgmPzujaKuyaqoFDYoFVeTqarZEoryfKZHkX6sIZt9SUpdn6IitjUBLcN1ET1RfFyISlhYEia7Uoppss7HmjkzlYPM21WQ11VRVtPN9rZJ23qaatqZGqf+SSLWdqBL7TeoglSWU+1/qqCyUUlXq1mxRVZnSh1TayI2kpui47jhSmY13SJWMnQiFW0A0qWWHU7jYiUi6NJ0GhYpylhhxi5h/roe4ZrG3WEPQf7wHQYdziMo2N2geFn6ZwFHRREr/wcAl3tJFhL05cDB5TW+t0u/hpTcB9O50Bt0b9JDgZYLJkMly7HNRcurfVdFPqzF5nkcPS/or7mIIhE2P3vY9oK+J57sl39eKQLIGgjqO+R0RnUtM74oWqxLpPkSGQLn4Sn/3GQZLn4DFD2gK3mEb3oj63cIFcFbrawMdSP1E8GIfXXpgEYEgzjHW/clPosNu8PHzfwEaydQUtWoAAA==</value>
</data>
<data name="DefaultSchema" xml:space="preserve">
<value>dbo</value>
</data>
</root>

View 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 PopulateMembershipTypes : IMigrationMetadata
{
private readonly ResourceManager Resources = new ResourceManager(typeof(PopulateMembershipTypes));
string IMigrationMetadata.Id
{
get { return "201901191431535_PopulateMembershipTypes"; }
}
string IMigrationMetadata.Source
{
get { return null; }
}
string IMigrationMetadata.Target
{
get { return Resources.GetString("Target"); }
}
}
}

View File

@ -0,0 +1,20 @@
namespace Vidly.Migrations
{
using System;
using System.Data.Entity.Migrations;
public partial class PopulateMembershipTypes : DbMigration
{
public override void Up()
{
Sql("INSERT INTO MembershipTypes (Id, SignUpFee, DurationInMonth, DiscountRate) VALUES (1,0,0,0)");
Sql("INSERT INTO MembershipTypes (Id, SignUpFee, DurationInMonth, DiscountRate) VALUES (2, 30, 1, 30)");
Sql("INSERT INTO MembershipTypes (Id, SignUpFee, DurationInMonth, DiscountRate) VALUES (3, 90, 3, 15)");
Sql("INSERT INTO MembershipTypes (Id, SignUpFee, DurationInMonth, DiscountRate) VALUES (4, 300, 12, 20)");
}
public override void Down()
{
}
}
}

View 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>H4sIAAAAAAAEAOVdW2/juhF+L9D/IOipLXLsXLqLbWCfg6yTtEFzQ5ws+hbQEu0IK1E+EpWNUZxf1of+pP6FkrqZV4mSZdlucYCDWCK/GQ5nyOFwRvuff/179MtH4FvvMIq9EI3tk8GxbUHkhK6HFmM7wfOfvti//Pz7342u3ODD+la0O6PtSE8Uj+03jJfnw2HsvMEAxIPAc6IwDud44ITBELjh8PT4+C/Dk5MhJBA2wbKs0VOCsBfA9Af5OQmRA5c4Af5d6EI/zp+TN9MU1boHAYyXwIFj+5vn+qtB1s62LnwPEB6m0J/bFkAoxAATDs9fYjjFUYgW0yV5APzn1RKSdn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/wcAl3tJFhL05cDB5TW+t0u/hpTcB9O50Bt0b9JDgZYLJkMly7HNRcurfVdFPqzF5nkcPS/or7mIIhE2P3vY9oK+J57sl39eKQLIGgjqO+R0RnUtM74oWqxLpPkSGQLn4Sn/3GQZLn4DFD2gK3mEb3oj63cIFcFbrawMdSP1E8GIfXXpgEYEgzjHW/clPosNu8PHzfwEaydQUtWoAAA==</value>
</data>
<data name="DefaultSchema" xml:space="preserve">
<value>dbo</value>
</data>
</root>

View 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 ApplyAnnotationsToCustomerName : IMigrationMetadata
{
private readonly ResourceManager Resources = new ResourceManager(typeof(ApplyAnnotationsToCustomerName));
string IMigrationMetadata.Id
{
get { return "201901191449134_ApplyAnnotationsToCustomerName"; }
}
string IMigrationMetadata.Source
{
get { return null; }
}
string IMigrationMetadata.Target
{
get { return Resources.GetString("Target"); }
}
}
}

View File

@ -0,0 +1,18 @@
namespace Vidly.Migrations
{
using System;
using System.Data.Entity.Migrations;
public partial class ApplyAnnotationsToCustomerName : DbMigration
{
public override void Up()
{
AlterColumn("dbo.Customers", "Name", c => c.String(nullable: false, maxLength: 255));
}
public override void Down()
{
AlterColumn("dbo.Customers", "Name", c => c.String());
}
}
}

View 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>H4sIAAAAAAAEAOVdW2/juhF+L9D/IOipLXLsXLqLbWCfg6yTtEFzQ5ws+hbQEu0IK1E6EpWNUZxf1of+pP6FkrpZvEmULMtyiwMcxBL5zXA4Qw6HM9r//Ovfk18+PNd4h2Hk+GhqnoyOTQMiy7cdtJqaMV7+9MX85eff/25yZXsfxre83RltR3qiaGq+YRycj8eR9QY9EI08xwr9yF/ikeV7Y2D749Pj47+MT07G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vzxSbieyJH+dmkhpOeXwyx6lRVOyqt2aLaoqa/qQyhyZkdQUINcdRyoz8w6pqrEToTALiCLN7HCKGDsRSZem06BoUcwYI25R6d/yIa5Z5Kw2EPRf9kHQYhyios0NWvq5X8ZxlDcR0n8wsIm3dBFiZwksTF7TW6vk23jJTQC9O11A+wY9xDiIMRkyWY5dJkpO/bsq+kllJsvz5CGgv6IuhkDYdOht3wP6GjuuXfB9LQkkKyCo45jdEdG5xPSuaLUukO59pAmUia/wd5+hF7gELHpAc/AO2/BG1O8WroC13lwbqEDqJ4IV++TSAasQeFGGselPfhIdtr2Pn/8L1R7OLtJqAAA=</value>
</data>
<data name="DefaultSchema" xml:space="preserve">
<value>dbo</value>
</data>
</root>

View File

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
@ -8,7 +9,11 @@ namespace Vidly.Models
public class Customer
{
public int Id { get; set; }
[Required]
[StringLength(255)]
public string Name { get; set; }
public bool IsSubscribedToNewsLetter { get; set; }
public MembershipType MembershipType { get; set; }
public byte MembershipTypeId { get; set; }
}
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Vidly.Models
{
public class MembershipType
{
public byte Id { get; set; }
public short SignUpFee { get; set; }
public byte DurationInMonth { get; set; }
public byte DiscountRate { get; set; }
}
}

View File

@ -189,11 +189,24 @@
<Compile Include="Migrations\201901181614018_AddIsSubscribedToNewsLetter.Designer.cs">
<DependentUpon>201901181614018_AddIsSubscribedToNewsLetter.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\201901181642319_AddMembershipType.cs" />
<Compile Include="Migrations\201901181642319_AddMembershipType.Designer.cs">
<DependentUpon>201901181642319_AddMembershipType.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\201901191431535_PopulateMembershipTypes.cs" />
<Compile Include="Migrations\201901191431535_PopulateMembershipTypes.Designer.cs">
<DependentUpon>201901191431535_PopulateMembershipTypes.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\201901191449134_ApplyAnnotationsToCustomerName.cs" />
<Compile Include="Migrations\201901191449134_ApplyAnnotationsToCustomerName.Designer.cs">
<DependentUpon>201901191449134_ApplyAnnotationsToCustomerName.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\Configuration.cs" />
<Compile Include="Models\AccountViewModels.cs" />
<Compile Include="Models\Customer.cs" />
<Compile Include="Models\IdentityModels.cs" />
<Compile Include="Models\ManageViewModels.cs" />
<Compile Include="Models\MembershipType.cs" />
<Compile Include="Models\Movie.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Startup.cs" />
@ -288,6 +301,15 @@
<EmbeddedResource Include="Migrations\201901181614018_AddIsSubscribedToNewsLetter.resx">
<DependentUpon>201901181614018_AddIsSubscribedToNewsLetter.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Migrations\201901181642319_AddMembershipType.resx">
<DependentUpon>201901181642319_AddMembershipType.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Migrations\201901191431535_PopulateMembershipTypes.resx">
<DependentUpon>201901191431535_PopulateMembershipTypes.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Migrations\201901191449134_ApplyAnnotationsToCustomerName.resx">
<DependentUpon>201901191449134_ApplyAnnotationsToCustomerName.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>

View File

@ -12,12 +12,22 @@
}
else
{
<ul>
<table class="table table-bordered table-hover">
<thead>
<tr>
<th>Customer</th>
<th >Discount Rate</th>
</tr>
</thead>
<tbody>
@foreach (var customer in Model.Customers)
{
@*<li>@customer.Name</li>*@
<li>@Html.ActionLink(@customer.Name, "Details", "Customers", new { id = @customer.Id },null)</li>
<tr>
<td>@Html.ActionLink(@customer.Name, "Details", "Customers", new { id = @customer.Id }, null)</td>
<td>@customer.MembershipType.DiscountRate%</td>
</tr>
}
</ul>
</tbody>
</table>
}