This file contains hidden or 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 AppHost : AppHostBase | |
{ | |
public AppHost() : base("Web",typeof(MyServices).Assembly){} | |
public override void Configure(Container container) | |
{ | |
GlobalRequestFilters.Add((req, res, requestDto) => { | |
var sessionId = req.GetCookieValue("user-session"); | |
if (sessionId == null) | |
res.ReturnAuthRequired(); |
This file contains hidden or 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 ContactServices | |
{ | |
public object Get(GetContacts request) | |
{ | |
var contacts = request.Id == null ? | |
Db.Select<Contact>() : | |
Db.Select<Contact>(x => x.Id == request.Id.ToInt()); | |
return contacts; | |
} | |
This file contains hidden or 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
[Route("/hello")] | |
[Route("/hello/{Name}")] | |
public class Hello : IReturn<HelloResponse> | |
{ | |
public string Name { get; set; } | |
} | |
public class HelloResponse | |
{ | |
public string Result { get; set; } |
This file contains hidden or 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
var client = new JsonServiceClient(baseUrl); | |
List<Contact> response = client.Get(new GetContacts()); |
This file contains hidden or 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 AppHost : AppHostBase | |
{ | |
public AppHost() : base("Web",typeof(MyServices).Assembly){} | |
public override void Configure(Container container) | |
{ | |
var connectionString = | |
"Server=127.0.0.1;Port=5432;" + | |
"Database=host;User Id=user;" + | |
"Password=myPassword;"; |
This file contains hidden or 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 AppHost : AppHostBase | |
{ | |
public AppHost() : base("Web", | |
typeof(MyServices).Assembly) { } | |
public override void Configure(Container container) | |
{ | |
var connectionString = "redis://localhost:6379"; | |
// Register client manager. | |
container.Register<IRedisClientsManager>( |
This file contains hidden or 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 AppHost : AppHostBase | |
{ | |
public AppHost() : base("Web",typeof(MyServices).Assembly){} | |
public override void Configure(Container container) | |
{ | |
var connectionString = | |
"Server=127.0.0.1;Port=5432;" + | |
"Database=myDataBase;User Id=myUsername;" + | |
"Password=myPassword;"; |
This file contains hidden or 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 AppHost : AppHostBase | |
{ | |
public AppHost() : base("Web",typeof(MyServices).Assembly){} | |
// Configure your AppHost with the necessary configuration | |
// and dependencies your App needs | |
public override void Configure(Container container) | |
{ | |
SetConfig(new HostConfig { | |
DebugMode = AppSettings.Get( |
This file contains hidden or 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 AppHost : AppHostBase | |
{ | |
public AppHost() : base("Web",typeof(MyServices).Assembly) | |
{ | |
var customSettings = new FileInfo("appsettings.txt"); | |
if (customSettings.Exists) | |
{ | |
AppSettings = new TextFileSettings(customSettings.FullName); | |
} | |
} |