Implicit Entity Field Assignment

Posts   
 
    
fdb
User
Posts: 43
Joined: 01-Jul-2008
# Posted on: 19-Oct-2008 14:24:35   

Hi,

For each DB table we have some common fields like:

CompanyID: Indicates the owner of the record. UserID: Indicates the last user who had performed an action on the record. UserAction: Indicates the last action performed by the user on the record. LastModificationDate: Indicates the last modification date on the record.

These fields should be read-only for the application developer. Our core framework classes are responsible for manipulation of these fields.

I wonder if it might be feasible to implicitly assign a value to the specified fields before CRUD operations?

Is it possible to force LLBLGen to add an extra where clause to LINQ queries or the generated SQL commands to read current user's company id and filter table rows for the specified company?

Regards, Farzad Badili

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 20-Oct-2008 11:04:31   

Implicit Entity Field Assignment can be done in validation, specifically ValidateEntityBeforeSave.

fdb
User
Posts: 43
Joined: 01-Jul-2008
# Posted on: 20-Oct-2008 12:39:51   

Thanks for your answer.

What is your solution for select statements and reading data(LINQ and etc.)?

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 20-Oct-2008 15:51:18   

Did you check the Authorization feature?

fdb
User
Posts: 43
Joined: 01-Jul-2008
# Posted on: 26-Oct-2008 08:56:42   

I have many rows in my table and I would like to filter them for a specified CompanyID and then perform pagination on the result. I would like to perform these operations on the DB side not in the client. Is it possible with Authorization feature? simple_smile

fdb
User
Posts: 43
Joined: 01-Jul-2008
# Posted on: 27-Oct-2008 07:38:19   

I'm working on a solution for this problem, please have a look at this and tell me your idea:

http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=14583

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 27-Oct-2008 11:53:15   

I have many rows in my table and I would like to filter them for a specified CompanyID and then perform pagination on the result. I would like to perform these operations on the DB side not in the client. Is it possible with Authorization feature?

No, Authorization only works on client side.

I'm working on a solution for this problem, please have a look at this and tell me your idea: http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=14583

I've replied on that thread.