26ff8d9b4f
Set up repository with legacy .NET Framework 4.8 source (OLD/), new .NET 10 Blazor solution (NEW/), OpenSpec specifications, documentation, and project configuration.
31 lines
874 B
C#
31 lines
874 B
C#
using System.Linq.Expressions;
|
|
using JdeScoping.Core.Models.Inventory;
|
|
using JdeScoping.DataSync.Contracts;
|
|
|
|
namespace JdeScoping.DataSync.Configuration.MergeConfigurations;
|
|
|
|
/// <summary>
|
|
/// Merge configuration for Item entities.
|
|
/// </summary>
|
|
public sealed class ItemMergeConfiguration : IMergeConfiguration<Item>
|
|
{
|
|
public string TableName => "Item";
|
|
|
|
public Expression<Func<Item, object>> MatchOn =>
|
|
x => x.ShortItemNumber;
|
|
|
|
public Expression<Func<Item, object>>? UpdateColumns =>
|
|
x => new
|
|
{
|
|
x.ItemNumber,
|
|
x.Description,
|
|
x.PlanningFamily,
|
|
x.StockingType
|
|
};
|
|
|
|
public Expression<Func<Item, Item, bool>>? UpdateWhen =>
|
|
(src, tgt) => src.LastUpdateDt > tgt.LastUpdateDt;
|
|
|
|
public Expression<Func<Item, object>>? InsertColumns => null;
|
|
}
|