I am sending value in object orderContract
which will replace values of entity if contract value is not null but if contract property is null it will retain its own value.
Currently I have used coalesce operator as in 2nd line of code. Is there a way where I don't have to repeat existing value?
var ordersEntity = _repository.Read<Entities.Orders>(orderContract.Id);
ordersEntity.Status = orderContract.Status ?? ordersEntity.Status;