CSLA .NET

Vibrant discussion about CSLA .NET and using the framework to build great business applications.

Rules for delete

Answered (Verified) This post has 1 verified answer | 1 Reply | 1 Follower

Not Ranked
1 Posts
Alexey posted on Mon, Mar 26 2012 3:26 AM

 

Good day

Learn CSLA, developing an small project.

I have a company and the person objects.

In humans, one company, the company has a few people.

 

How do I make a rule that allows you to remove the company that are not referenced from the people and does not allow if the links are?

 

Answered (Verified) Verified Answer

Top 10 Contributor
1,765 Posts
Verified by Alexey

There's 2 kinds of delete:

Immediate Deletion (only takes an Id in) and should return an Exception if delete is not possible.
                                      IE, Implement the check in DataPortal_Delete or use Refernetial Integrity in the database.

Deferred Deletion (an object is loaded, marked as deleted but actual delete does not happen until Save is called). 
Here you can create an AuthorizationRule that will accept the object and check if object has "children").

Jonny Bekkum, Norway CslaContrib Coordinator

Page 1 of 1 (2 items) | RSS

Copyright (c) 2006-2010 Marimer LLC. All rights reserved.
Email admin@lhotka.net for support.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems