-
Nov 5th, 2013, 02:47 AM
#1
Thread Starter
New Member
[RESOLVED] passing objects or values
In asp.net I am checking whether the Username and password in the login view is equal to those details in the database. From the controller layer a method of service layer is accessed and from service layer the method in the repository was accessed. I want to access the object in the repository to the service layer and then to controller,How can I do this?
-
Nov 5th, 2013, 03:16 AM
#2
Re: passing objects or values
The same way it's always done. Use functions and get the return value. The repository method returns a result - maybe just a Boolean or maybe a User object or maybe something that incorporates either or both of those with some other information besides - and the service method uses that and then either returns it to the controller action or creates some new object that contains the appropriate data and returns that. Just as passing parameters down the layers doesn't change just because there are layers, so passing results back up the layers is no different to any other methods.
-
Nov 8th, 2013, 02:12 AM
#3
Re: passing objects or values
Hello,
Based on your other threads, I am going to assume that this is also ASP.Net MVC, so I will move the thread to correct forum.
Have you seen the following example application:
http://www.asp.net/mvc/tutorials/mvc...c-store-part-1
Specifically:
http://www.asp.net/mvc/tutorials/mvc...c-store-part-7
I think this might help you with the task that you are currently doing.
Gary
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|