Skip to content

Commit

Permalink
Merge branch 'azabluda-bug-MergeChanges-inherited' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Anthony Sneed committed Apr 20, 2015
2 parents e9c26a0 + 7669bcf commit 49f2cb5
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using System;
using Newtonsoft.Json;

namespace TrackableEntities.Client.Tests.Entities.NorthwindModels
{
[JsonObject(IsReference = true)]
public class PriorityOrder : Order
{
private string _priorityPlan;
public string PriorityPlan
{
get { return _priorityPlan; }
set
{
if (value == _priorityPlan) return;
_priorityPlan = value;
NotifyPropertyChanged(() => PriorityPlan);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
<Compile Include="Mocks\MockNorthwind.cs" />
<Compile Include="NorthwindModels\Area.cs" />
<Compile Include="NorthwindModels\CustomerSetting.cs" />
<Compile Include="NorthwindModels\PriorityOrder.cs" />
<Compile Include="NorthwindModels\PromotionalProduct.cs" />
<Compile Include="NorthwindModels\Territory.cs" />
<Compile Include="NorthwindModels\Employee.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,9 @@ public void MergeChanges_Should_Set_TrackingState_To_Unchanged_For_Added_Order_W
{
// Arrange
var database = new MockNorthwind();
var origOrder = new Order
var origOrder = new PriorityOrder
{
PriorityPlan = "Silver",
OrderDate = DateTime.Parse("1996-07-04"),
CustomerId = "ALFKI"
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ private static void SetEntityProperties(this ITrackable targetItem, ITrackable s
#if SILVERLIGHT || NET40
foreach (var prop in targetItem.GetType().GetProperties().Where(p => p.CanWrite)
#else
foreach (var prop in targetItem.GetType().GetTypeInfo().DeclaredProperties
foreach (var prop in targetItem.GetType().BaseTypes().SelectMany(t => t.GetTypeInfo().DeclaredProperties)
.Where(p => p.CanWrite && !p.GetMethod.IsPrivate)
#endif
.Except(targetItem.GetNavigationProperties(false).Select(np => np.Property)))
Expand Down

0 comments on commit 49f2cb5

Please sign in to comment.