http://www.slideshare.net/mkennedy66996693/building-web-apps-with-aspnet-mvc-and-nosql
https://www.youtube.com/watch?v=PDrlzgGSaSk
time 49.59 added javascript
time 30:00 add book
Add ViewModels folder to put dataAnnotations in the models
BookViewModel
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using MongoDB.Bson;
namespace Amazoon.Web.ViewModels
{
public class BookViewModel
{
//[Required] public ObjectId CategoryId { get; set; } Note: I have to change it to string to //get it to work
[Required] public string CategoryId { get; set; }
[Required] public string Name { get; set; }
[Required] public string ImageUrl { get; set; }
[Required] public float Price { get; set; }
}
}
No comments:
Post a Comment