Prevent binding on some columns in order

This commit is contained in:
Praburaj 2014-08-12 12:28:11 -07:00
parent abd215a543
commit cb9184e1c0
1 changed files with 7 additions and 1 deletions

View File

@ -1,4 +1,5 @@
using System.Collections.Generic;
using Microsoft.AspNet.Mvc.ModelBinding;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace MusicStore.Models
@ -6,12 +7,15 @@ namespace MusicStore.Models
//[Bind(Include = "FirstName,LastName,Address,City,State,PostalCode,Country,Phone,Email")]
public class Order
{
[BindNever]
[ScaffoldColumn(false)]
public int OrderId { get; set; }
[BindNever]
[ScaffoldColumn(false)]
public System.DateTime OrderDate { get; set; }
[BindNever]
[Required]
[ScaffoldColumn(false)]
public string Username { get; set; }
@ -59,9 +63,11 @@ namespace MusicStore.Models
[DataType(DataType.EmailAddress)]
public string Email { get; set; }
[BindNever]
[ScaffoldColumn(false)]
public decimal Total { get; set; }
[BindNever]
public List<OrderDetail> OrderDetails { get; set; }
}
}