StarTrekRedneck

Arkansas

Jan
23
answered Web app using API for everything?
Dec
8
awarded Good Answer
Jul
30
comment ELMAH and API controller in MVC4 not logging errors
It's probably worth noting that API controllers are in Web API, not MVC. The separate execution paths for each is often the cause of incompatibility of an MVC-targeted library with Web API. Each request either goes MVC, or it goes Web API. The two are side-by-side and don't interact (Web API is not a feature inside MVC execution). They have different contexts, different route tables, different configs, all different, all separate.
Jun
10
accepted How to return a relative URL from ASP.NET's GetUrlHelper()?
Jun
10
comment How to return a relative URL from ASP.NET's GetUrlHelper()?
Thanks! That's definitely the cleanest way to pull out the relative from the absolute. What I was really hoping for was a way to get the relative URL directly from the framework without having it interrogate the request object for scheme, etc. But I'll take what I can get.
Jun
7
revised How to return a relative URL from ASP.NET's GetUrlHelper()?
deleted 6 characters in body
Jun
7
revised How to return a relative URL from ASP.NET's GetUrlHelper()?
added 212 characters in body
Jun
6
asked How to return a relative URL from ASP.NET's GetUrlHelper()?
May
9
revised How to format a JSON date?
Edit to empasize this is a hack and no longer recommended
Apr
9
awarded Nice Answer
Feb
26
comment Can the Location header be used for multiple resource locations in a 201 Created response?
Yes, but the question still remains: in a batch create situation how does one return all the individual resource locations? A long-winded approach: compile those resource locations into their own resource and return a URL to that, but like I said, it's a bit long-winded.
Feb
18
awarded Popular Question
Dec
10
awarded Necromancer
Nov
17
awarded Yearling
Jul
10
answered Custom HTTP Authorization Header
May
16
comment Is IDependencyResolver an anti-pattern?
The IDependencyResolver is just a tool; how it's used is the pattern. It's an oversimplification to equate it with the Service Locator Pattern. Don't reference it from your code, and stick to constructor injection.
May
16
comment Is IDependencyResolver an anti-pattern?
Maybe we're disagreeing about how to use IDependencyResolver. I would never encourage folks to have IDR.Resolve() in their code other than the one place at the top of the App. Is that what's being assumed when using IDR, that I've got all my classes asking it for stuff? Nay! I'm a big advocate for constructor injection. I have to agree with Steven in that one has to resolve even the IControllerFactory somewhere. The framework originally did that manually, now it abstracts that with the IDR which it also uses for other stuff that used to be hard-coded in the framework.
Feb
9
comment Simple application architecture advice
IMHO, he should start with a WebApp->Core reference and a WebApp->Infrastructure reference which is a collection of implementations of business concepts that require external dependencies (not just data access). IoC bootstrapping is called from the startup of the WebApp. That's a minimal solution that brings no restrictions. If he wants to separate out the DataAccess into it's own assembly with DTOs and mapping, he can do so easily and handle mapping in the infrastructure assembly which will ref that DataAccess layer, but he doesn't have to. The Core will remain standalone and very testable.
Feb
9
comment Simple application architecture advice
I agree that complexity of the site is a major factor. And since the goal is loose coupling and testability, constructor-based dependency injection seems ideal here. I think direct chain referencing like in your diagram is too simplistic to pull this off because there's no hub from which an IoC container can operate. It may also imply (to me at least) that we're "newing" stuff up, which is a unit test killer.
Feb
9
comment Simple application architecture advice
It is a mistake for the root business logic (Core/Domain/etc.) to reference any technological implementation, such as a database, file system, etc. The business concepts are to be stand alone. The data access layer is an implementation of a business concept, e.g., an IOrderRepository or even an IRetrieveOrderProcess. That is why Core should not reference DataAccess.
1 2 3