Skip to content

Instantly share code, notes, and snippets.

View tibinthomas's full-sized avatar
💭
Logically, you can't create your own laws.

Tibin Thomas tibinthomas

💭
Logically, you can't create your own laws.
  • India
View GitHub Profile
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Vidly.Models
{
public class Movie
{
public int Id { get; set; }
@tibinthomas
tibinthomas / customerscontroller.cs
Created March 15, 2017 09:50
Error at _context.SaveChanges();
[HttpPost]
public ViewResult Save(Customer customer )
{
if (customer.Id == 0)
{
_context.Customers.Add(customer);
}
else
{
var customerInDB = _context.Customers.Single(c => c.Id == customer.Id);