First time user, I've been enjoying using LinqConnect, but one of the key features for me, was being able to pass around DTOs, then convert these back to entities and save the changes to the database (SQL). This is not working, even with the asModified flag set.
I have the code:
Code: Select all
private PatientRecord UpdateEntity(PatientRecord record, int userId = -1)
{
record.FullName = "WHAT THE...?";
var entity = record.ToEntity();
DataContext.PatientRecords.Attach(entity, true);
DataContext.SubmitChanges();
return entity.ToDtoWithRelated(1);
}
I've tried loading the original entity from the database, and passing this in to the overload (entity, original) but still no luck.
All I can think of doing now, is to use Automapper to set the properties of the DTO on the "original", attached entity and submit changes, but this makes life awkward and is quite an overhead.
I notice from these forums that bugs such as these have happened before. Please can you update me on the issue as soon as possible? The reason that I purchased a license for LinqConnect was the speed of development (and performance), but this is really going to hold me up if not resolved pretty soon.
Thanks in advance,
Tom