File tree Expand file tree Collapse file tree
test/Xrm.Oss.UnitOfWork.Tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77
88namespace Xrm . Oss . UnitOfWork
99{
10+ public partial class UpdateContext : UpdateContext < Entity >
11+ {
12+ public UpdateContext ( Entity entity ) : base ( entity ) { }
13+ }
14+
1015 public partial class UpdateContext < T > : IDisposable where T : Entity
1116 {
1217 private T _initialState ;
Original file line number Diff line number Diff line change @@ -48,6 +48,25 @@ public void Should_Add_Newly_Added_Attributes()
4848 }
4949 }
5050
51+ [ Fact ]
52+ public void Non_Generic_Class_Should_Fall_Back_To_Plain_Entity ( )
53+ {
54+ var contact = new Entity
55+ {
56+ LogicalName = "contact" ,
57+ Id = Guid . NewGuid ( )
58+ } ;
59+
60+ using ( var updateContext = new UpdateContext ( contact ) )
61+ {
62+ contact [ "firstname" ] = "Frodo" ;
63+
64+ var update = updateContext . GetUpdateObject ( ) ;
65+
66+ Assert . True ( update . Contains ( "firstname" ) ) ;
67+ }
68+ }
69+
5170 [ Fact ]
5271 public void Should_Not_Add_Unchanged_Attributes ( )
5372 {
You can’t perform that action at this time.
0 commit comments