I\'m working with a legacy database in Oracle and some of my tables have columns that are set to NOT-NULL that I don\'t want in my domain model, but, obviously, I need to sp
If you don't want to pollute your POCOs, an Interceptor probably is the best option. Take a look at various articles about interceptors, like this one.
On your interceptor, you'd want to check the type so you know which fields to put dummy data in. Make sure you use currentState[] in the OnFlushDirty method (OnFlushDirty is "update") and state[] in the OnSave method ("insert"). For example (OnSave):
if (entity is Group)
{
state[Array.IndexOf(propertyNames, "Indentation")] = "dummy value";
return true;
}
return false;
Edit:
You're trying to insert data that doesn't exist in your domain but is required by your database model, so the above wouldn't quite work for you. Instead, you'll have to add an element to each of the state, propertyNames, and types arrays.