Entity data field validation and part data submission

Posted by pradeeptp on Stack Overflow See other posts from Stack Overflow or by pradeeptp
Published on 2010-01-18T04:11:19Z Indexed on 2010/04/09 9:53 UTC
Read the original article Hit count: 268

Filed under:
|

I have an entity class that has 10 fields. I am using MS Validation Application block to mark all fields as mandatory (IsRequired). I am implementing a securiy feature in which during updation of the data, not all the fields in the entity class will have data. For example a few users can only view 5 fileds while others all 10 fields during updation on GUI

I have the following options

1) Bring all the data for all the fields from the DB table and hide the ones not accessible to the users in GUI. I am concerned about the performance because everytime GUI will pull unncessary data.

2) Bring the data (e.g. only 5 fields) that are permissible for access/view by the user on GUI. During submit, validation block will throw exception because all fields are marked as IsRequired and only data for 5 fields are sent back to the server.

I want to know if there are any other good approaches to solve problems like this.

I am using .NET 3.5

Thanks.

© Stack Overflow or respective owner

Related posts about .net-3.5

Related posts about c#3.0