Je veux mettre à jour une ligne de table et j'ai un code suivantSubsonic 3.0.0.5 Migration Mise à jour Row
updatePrimaryPaymentAndSecondaryPaymentSourceTypes void()
{
LookUpDetails lookUpDetail = new LookUpDetails(); Var repo = new SimpleRepository ("E2Lending", "SimpleRepositoryOptions.RunMigrations")
lookUpDetail = repo.Single (80);
lookUpDetail.Col1Value = "Mon compte de contrôle";
repo.Update (lookUpDetail);
}
LookUpDetails public class
{
[SubSonicPrimaryKey]
public int LookUpDetailId {get; set;}
public int LookUpGroupId { get; set; }
public string Code { get; set; }
public int SortOrder { get; set; }
public string Col1Value { get; set; }
[SubSonicNullString]
public string Col2Value { get; set; }
[SubSonicNullString]
public string Col3Value { get; set; }
[SubSonicNullString]
public string Col4Value { get; set; }
[SubSonicNullString]
public string Col5Value { get; set; }
public DateTime CreatedOn { get; set; }
public string CreatedBy { get; set; }
public DateTime ModifiedOn { get; set; }
public string ModifiedBy { get; set; }
public Boolean IsActive { get; set; }
}
Quand je puis exécutez repo.Update (lookUpDetail); me montre Null référence Exception. Pouvez-vous me dire comment je vais pouvoir mettre à jour un seul enregistrement dans une table?
Cordialement