Created
July 10, 2011 10:30
-
-
Save RexMorgan/1074452 to your computer and use it in GitHub Desktop.
FubuMVC FubuContinuation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FrontLoaderEndpoint | |
{ | |
private readonly IUserRepository _userRepository; | |
public FrontLoaderEndpoint(IUserRepository userRepository) | |
{ | |
_userRepository = userRepository; | |
} | |
public FubuContinuation Get(FrontLoaderRequestModel input) | |
{ | |
var user = _userRepository.GetByDomain(input.HTTP_HOST); | |
if(user != null) | |
{ | |
return FubuContinuation.TransferTo(new UserSpecificIndexRequestModel | |
{ | |
User = user | |
}); | |
} | |
return FubuContinuation.RedirectTo(new HomeRequestModel()); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FrontLoaderRequestModel | |
{ | |
public string HTTP_HOST { get; set; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment