Web.config application variable scoped objects

37 views
Skip to first unread message

Gary Brunton

unread,
May 22, 2012, 4:52:01 PM5/22/12
to fubumv...@googlegroups.com
In the following link Artem asked if there were Session scoped objects and to my surprise there are.


Now I'm wondering if there are Web.config application variable scoped objects as well?

Any thoughts on this?

Gary

Michael Murray

unread,
May 22, 2012, 4:58:53 PM5/22/12
to fubumv...@googlegroups.com
The following namespace may be of interest to you: FubuCore.Configuration


I have used it once before to get an App.config or Web.config setting and have it automatically model bound to a route input model. I don't believe it's very well documented at this time.

Is this what you had in mind?


Gary

--
You received this message because you are subscribed to the Google Groups "FubuMVC Development Group" group.
To view this discussion on the web visit https://groups.google.com/d/msg/fubumvc-devel/-/m1NZuoHN_ssJ.
To post to this group, send email to fubumv...@googlegroups.com.
To unsubscribe from this group, send email to fubumvc-deve...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/fubumvc-devel?hl=en.

Joey

unread,
May 22, 2012, 6:39:59 PM5/22/12
to fubumv...@googlegroups.com
Chad has something about it @


Not sure how up to date it is though with the latest fubu bits.
To unsubscribe from this group, send email to fubumvc-devel+unsubscribe@googlegroups.com.

Gary Brunton

unread,
May 22, 2012, 7:07:44 PM5/22/12
to fubumv...@googlegroups.com
Whoa.. Joey, that link discusses exactly what I was looking for.  I'll be giving it a try.

Thanks!
Gary

Gary Brunton

unread,
May 22, 2012, 7:19:38 PM5/22/12
to fubumv...@googlegroups.com
It works beautifully. Thanks!

Gary

Peter Wetzel

unread,
May 24, 2012, 1:32:51 PM5/24/12
to fubumv...@googlegroups.com
I went through that post, but it's not clicking for me (still fairly new to fubu, structuremap, etc.). In my case I have a helper class for handling emails currently using static methods and have an EmailSettings class setup along with appropriately named values in my web config. Do I need to do additional configuration? How would I grab the values, assuming a pretty close to out-of-the-box fubumvc project? I'm guessing it's pretty straight forward and I'll feel silly for not getting it.

Chad Myers

unread,
May 24, 2012, 2:48:36 PM5/24/12
to fubumv...@googlegroups.com
The static methods will probably get you.

Your helper needs come out of the container and take in your EmailSettings object in the c'tor.

FubuMVC automatically sets up the SettingsScanner, I think. So you shouldn't need to do anything extra there.

-Chad

To view this discussion on the web visit https://groups.google.com/d/msg/fubumvc-devel/-/lrDp60CmhIQJ.

To post to this group, send email to fubumv...@googlegroups.com.
To unsubscribe from this group, send email to fubumvc-deve...@googlegroups.com.

Peter Wetzel

unread,
May 25, 2012, 1:15:58 AM5/25/12
to fubumv...@googlegroups.com
Ah, I was trying to hard as I assumed it was accessible explicitly.

I did a quick test and got it to work via parameter to the static method. However, if I want to have different logical setting classes for different utilities (say, one for email, another for caching) I'm guessing I'm out of luck with my current approach. Not the end of the world since I can always use the out-of-the-box app settings via the .net framework.

Thanks for the help. I'm in the midst of tearing out nhibernate and putting in dapper-based custom code, so I have bigger fish to fry :)
Reply all
Reply to author
Forward
0 new messages