protected long GetIdNullSafe(EntidadeDeBanco value) { if (value == null) { return(0); } return(value.Id); }
protected long GetIdNullSafe(EntidadeDeBanco value, string classeFilha, string classePai) { if (value == null) { throw new Exception($"Todo {classeFilha} deve estar associado a um {classePai}!"); } return(value.Id); }