Skip to content

Commit

Permalink
rename functions for readability (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnazariah authored Nov 3, 2020
1 parent 59ad8e1 commit 6ab81a8
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion proto-csharp/standalone-silo/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public static void Main(string[] args) =>
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host
.CreateDefaultBuilder(args)
.ApplyAppConfiguration()
.ConfigureHostConfigurationDefaults()
.UseOrleans(new SiloConfigurator().ConfigureSiloHost);
}
}
4 changes: 2 additions & 2 deletions proto-csharp/webapi-directclient/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ public static void Main(string[] args) =>
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host
.CreateDefaultBuilder(args)
.ApplyAppConfiguration()
.ApplyConfiguration(new WebApiConfigurator().ConfigureWebApiHost)
.ConfigureHostConfigurationDefaults()
.ApplyHostConfigurationFunc(new WebApiConfigurator().ConfigureWebApiHost)
.UseOrleans(new SiloConfigurator().ConfigureSiloHost);
}
}
2 changes: 1 addition & 1 deletion proto-fsharp/standalone-silo/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module Program =
[<EntryPoint>]
let Main args =
(Host.CreateDefaultBuilder args)
.ApplyAppConfiguration()
.ConfigureHostConfigurationDefaults()
.UseOrleans((new SiloConfigurator()).ConfigureSiloHost)
.Build()
.Run()
Expand Down
4 changes: 2 additions & 2 deletions proto-fsharp/webapi-directclient/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ module Program =
[<EntryPoint>]
let Main args =
(Host.CreateDefaultBuilder args)
.ApplyAppConfiguration()
.ApplyConfiguration((new WebApiConfigurator()).ConfigureWebApiHost)
.ConfigureHostConfigurationDefaults()
.ApplyHostConfigurationFunc((new WebApiConfigurator()).ConfigureWebApiHost)
.UseOrleans((new SiloConfigurator()).ConfigureSiloHost)
.Build()
.Run()
Expand Down
12 changes: 6 additions & 6 deletions universal-silo/Configuration.fs
Original file line number Diff line number Diff line change
Expand Up @@ -108,20 +108,20 @@ type UniversalSiloConfiguration = {
[<Extension>]
module Extensions =
type IHostBuilder with
member this.ApplyAppConfiguration() =
member this.ConfigureHostConfigurationDefaults() =
this.ConfigureHostConfiguration (fun cb ->
cb
.SetBasePath(Directory.GetCurrentDirectory())
|> ignore)

member this.ApplyConfiguration f =
member this.ApplyHostConfigurationFunc f =
f this

let [<Extension>] inline ApplyConfiguration (_this : IHostBuilder) (_func : Func<IHostBuilder, IHostBuilder>) =
_this.ApplyConfiguration (fun hb -> _func.Invoke hb)
let [<Extension>] inline ApplyHostConfigurationFunc (_this : IHostBuilder) (_func : Func<IHostBuilder, IHostBuilder>) =
_this.ApplyHostConfigurationFunc (fun hb -> _func.Invoke hb)

let [<Extension>] inline ApplyAppConfiguration (_this : IHostBuilder) =
_this.ApplyAppConfiguration()
let [<Extension>] inline ConfigureHostConfigurationDefaults (_this : IHostBuilder) =
_this.ConfigureHostConfigurationDefaults()

let [<Extension>] inline Apply (_this : 'a) (func : Func<'a, 'a>) : 'a =
func.Invoke _this
Expand Down

0 comments on commit 6ab81a8

Please sign in to comment.