Hello,
I have a error:
The type or namespace name 'EntityState' does not exist in the namespace 'System.Data.Entity'
But, I have added reference System.Data. Kindly answer me.
using DAL.Model;
using System;
using System.Collections.Generic;
//using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Linq.Expressions;
using System.Web;
namespace DMS.GenericRepository
{
public class GenericRepository where TEntity : class
{
internal DbSet dbSet;
public virtual void Update(TEntity entityToUpdate)
{
dbSet.Attach(entityToUpdate);
context.Entry(entityToUpdate).State = System.Data.Entity.EntityState.Modified;
}
}
Thanks Advance.
1 Reply
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.

Santhakumar MunuswamyPosted Sep 2, 2016, 5:21 AM