I think the only thing you can play with is to use the DbCommandInterceptor . You can intercept every command executed without a request (update, delete, insert) and change the text of the command until it is actually executed. The code here is only for understanding how this can be done. You can reorganize it for more convenient use:
public class PrependTextInterceptor : DbCommandInterceptor { const string table = "MyTable"; const string column = "Comments"; public override void NonQueryExecuting(DbCommand command, System.Data.Entity.Infrastructure.Interception.DbCommandInterceptionContext<int> interceptionContext) { command.CommandText = Regex.Replace(command.CommandText, string.Format(@"(?i:(?<=^UPDATE \[.+\]\.\[{0}\]\r\nSET .* \[{1}\] = ).+?(?=(,|\r\n)))", table, column), "$& + " + column); base.NonQueryExecuting(command, interceptionContext); } }
One more note. If you load your item normally, its Comments property must also be loaded. Thus, you lose the benefit of not downloading it sooner than adding it. I think you need to use Attach , in which you just need to know the ID in order to be able to update it without loading it (for example, via the context.Set<MyTable>().Single(e => e.ID == 2) , Comments ), and then it must be confidently loaded ).
source share