Working with beforeSaveEntity and Navigation Properties
My application allows the user to create products along with their UOM (Units of Measurement) and Barcodes During the creation process, API will check if there is no barcode entered, it will generate it automatically. That worked fine until I decided to add weight products that require scale barcodes with 7 digits. BeforeSaveEntity will ask if the product type is weight then generate 7 digits barcode, else, it will generate 13 digits. The problem is; I can't get this to work when checking the parent table, here is my code: Models: (for convenience, I have omitted unneeded properties.) public