I am using asp.net mVC2 and there are various controllers in different areas.
I need to select a value from the list of values contained in a database; For example, selecting a product or an employee.
I am currently thinking of being a controller who is dedicated to using these lists with dropdownologists. This controller will only ask DAL and will serve JSON objects on any view needs to be loaded with an AJAX call.
My only concern with this is that my idea will get data from different controllers at a time.
Am I rightly worried? Is there a better way to set this up, maybe Create another class that acts as a middle level between your controllers and data access codes is. Now you can call this class methods from differnt controllers. You can call it from your different controllers product / employee class to create a partially visible partially written share?
public class ItemService () {public static list & lt; Items & gt; GetItems () {var items = yourRepositary.GetItems (); Return the goods; }}
Public Action Result GetItems () {var items = ItemService.GetItems () ; Return Jason (Items, Jason Y. Best Behavior AloGuget); }
Comments
Post a Comment