score:1

Accepted answer

Better late than never:

If you have been using the Designer to create your LTS config and entities, you can right-click on the DBML file, and choose "Open With...". Now select XML Editor and click OK.

Find your Order_OrderDetail association in this file, then add DeleteOnNull="true" to it. Save the file and let LTS re-generate your classes for you. Done! No more having your changes to the generated code file overwritten again!

score:0

I'd build the assembly then use reflector to example the class to see if it has the attribute properties set from the partial class. If that don’t even work then you may need to try something else. That type of attribute overlap may not be supported.

What is it you're trying to achieve thru this?

score:1

Maybe you dont need the MetaData type. Will this work in your additional partial:

public partial class OrderDetail {
    [Association(DeleteOnNull = true)]
    public Order Order;
}

..i know that by itself Order is not defined, but you shouldn't need to build like that. This MSDN doc suggests that the above should be possible (if i'm reading it correctly).


Related Articles