I have been exploring different methods of editing/updating a record within Entity Framework 5 in an ASP.NET MVC3 environment, but so far none of them tick all of the boxes
public interface IRepository
{
void Update(T obj, params Expression>[] propertiesToUpdate) where T : class;
}
public class Repository : DbContext, IRepository
{
public void Update(T obj, params Expression>[] propertiesToUpdate) where T : class
{
Set().Attach(obj);
propertiesToUpdate.ToList().ForEach(p => Entry(obj).Property(p).IsModified = true);
SaveChanges();
}
}