using System.Collections.Generic;
using KellermanSoftware.CompareNetObjects;
public class ApproveDiscipline
public Guid AuthorizationId { get; set; }
public IEnumerable<string> Disciplines { get; set; } = new List<string>();
public bool IsCheckAirmenLetterUploaded { get; set; } = false;
public string Subject { get; set; } = string.Empty;
public Status Status { get; set; } = Status.Open;
public ApproveDiscipline? ApproveDiscipline { get; set; }
public static void Main()
var uuid = Guid.NewGuid();
var inDb = new CaseModel {
ApproveDiscipline = new() {
Disciplines = new List<string>() { "Discipline 1", "Discipline 2" },
IsCheckAirmenLetterUploaded = false
var update = new CaseModel {
ApproveDiscipline = new() {
Disciplines = new List<string>() { "Discipline 1", "Discipline 3"},
IsCheckAirmenLetterUploaded = true
var compareLogic = new CompareLogic();
compareLogic.Config.MaxDifferences = int.MaxValue;
compareLogic.Config.MembersToIgnore.Add(nameof(CaseModel.Status));
compareLogic.Config.MembersToIgnore.Add(nameof(ApproveDiscipline.IsCheckAirmenLetterUploaded));
var result = compareLogic.Compare(inDb, update);
Console.WriteLine("403 You cannot update properties: " + string.Join(",", result.Differences.Select(x => x.PropertyName)));