Skip to content

Commit

Permalink
Downgraded from .NET core 3.0 too .NET core 2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Schneider authored and Peter Schneider committed Feb 17, 2020
1 parent 1191dab commit 5347d54
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion PlanB.Butler.Bot/PlanB.Butler.Bot.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<TargetFramework>netcoreapp2.2</TargetFramework>
<LangVersion>latest</LangVersion>
</PropertyGroup>

Expand Down
6 changes: 2 additions & 4 deletions PlanB.Butler.Bot/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ public void ConfigureServices(IServiceCollection services)
{
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);

services.AddMvc(options => options.EnableEndpointRouting = false);
services.AddOptions();

// Create the Bot Framework Adapter with error handling enabled.
services.AddSingleton<IBotFrameworkHttpAdapter, AdapterWithErrorHandler>();

Expand Down Expand Up @@ -85,8 +82,9 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env)
app.UseDefaultFiles();
app.UseStaticFiles();

app.UseMvc();

// app.UseHttpsRedirection();

}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ public class CalenderTests
[TestMethod]
public void OnlyDefinedWorkdaysFail()
{

var culture = new System.Globalization.CultureInfo("de-DE");
var day = culture.DateTimeFormat.GetDayName(DateTime.Today.DayOfWeek);
var result =BotMethods.CalculateNextDay("test");
Assert.AreNotEqual(DateTime.MinValue, result);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<TargetFramework>netcoreapp2.2</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public string GetDocument(string container, string resourceName)
{
string resource = container + "/" + resourceName;
// TODO Util?
string sasToken=""; //= this.GenerateStorageSasToken(resource, ButlerBot.Util.Settings.StorageAccountUrl, ButlerBot.Util.Settings.StorageAccountKey);
string sasToken= this.GenerateStorageSasToken(resource, ButlerBot.Util.Settings.StorageAccountUrl, ButlerBot.Util.Settings.StorageAccountKey);
var response = httpClient.GetAsync(sasToken).Result;
return (response.Content.ReadAsStringAsync().Result);
}
Expand Down Expand Up @@ -85,7 +85,8 @@ public HttpStatusCode PutDocument(string container, string resourceName, string
string label = $"{container}/{resourceName}";
var brokerProperty = new JObject();
brokerProperty.Add("Label", label);
var connectionString = "";// TODO ButlerBot.Util.Settings.serviceBusConnectionString;
// TODO.
var connectionString = ButlerBot.Util.Settings.serviceBusConnectionString;
var sasToken = this.GenerateServiceBusSasToken(connectionString,queueName);
var uri = $"https{connectionString.Split(';')[0].ToString().Split('=')[1].Remove(0, 2)}/{queueName}/messages";
HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, uri);
Expand All @@ -104,8 +105,8 @@ public HttpStatusCode PutDocumentByteArray(string container, string resourceName
{
string label = $"{container}/{resourceName}";
var brokerProperty = new JObject();
brokerProperty.Add("Label", label);
var connectionString = "";// TODO: ButlerBot.Util.Settings.serviceBusConnectionString;
brokerProperty.Add("Label", label);// TODO:
var connectionString = ButlerBot.Util.Settings.serviceBusConnectionString;
var sasToken = this.GenerateServiceBusSasToken(connectionString,queueName);
var uri = $"https{connectionString.Split(';')[0].ToString().Split('=')[1].Remove(0, 2)}/{queueName}/messages";
HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, uri);
Expand Down
11 changes: 6 additions & 5 deletions PlanB.Butler.Library/PlanB.Butler.Library/BotMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,8 @@ public static HttpStatusCode NextOrderUpload(Order order)
/// <returns></returns>
public static async Task<List<OrderBlob>> GetDailyOverview()
{
var url = string.Empty; // TODO ButlerBot.Util.Settings.GetDailyOverviewFunc;
// TODO
var url = ButlerBot.Util.Settings.GetDailyOverviewFunc;
var response = await client.GetAsync(url);
var result = await response.Content.ReadAsStringAsync();
var tmp = JsonConvert.DeserializeObject<List<OrderBlob>>(result);
Expand All @@ -585,8 +586,8 @@ public static async Task<List<OrderBlob>> GetDailyOverview()
/// <param name="user"></param>
/// <returns></returns>
public static async Task<List<OrderBlob>> GetDailyUserOverview(string user)
{
var url = string.Empty; // TODO: ButlerBot.Util.Settings.GetDailyUserOverviewFunc;
{// TODO:
var url = ButlerBot.Util.Settings.GetDailyUserOverviewFunc;
client.DefaultRequestHeaders.Add("user", user);
var response = await client.GetAsync(url);
var result = await response.Content.ReadAsStringAsync();
Expand All @@ -601,8 +602,8 @@ public static async Task<List<OrderBlob>> GetDailyUserOverview(string user)
/// <param name="user"></param>
/// <returns></returns>
public static async Task<List<SalaryDeduction>> GetSalaryDeduction(string user)
{
var url = string.Empty; // TODO: ButlerBot.Util.Settings.GetSalaryDeduction;
{ // TODO:
var url = ButlerBot.Util.Settings.GetSalaryDeduction;
client.DefaultRequestHeaders.Add("user", user);
var response = await client.GetAsync(url);
var result = await response.Content.ReadAsStringAsync();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<TargetFramework>netcoreapp2.2</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
5 changes: 2 additions & 3 deletions PlanB.Butler.Services/PostDocument.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,11 @@ public static async void PostDocumentSalary([ServiceBusTrigger("q.planbutlerupda
[Singleton]
[FunctionName(nameof(PostDocumentExcel))]
public static void PostDocumentExcel([ServiceBusTrigger("q.planbutlerupdateexcel", Connection = "butlerSend")]Microsoft.Azure.ServiceBus.Message messageHeader,
[Blob("{Label}", FileAccess.ReadWrite, Connection = "StorageSend")]out string payload,
[Blob("{Label}", FileAccess.ReadWrite, Connection = "StorageSend")]out byte[] payload,
ILogger log)
{
// Implement Logging after MVP.

payload = Encoding.Default.GetString(messageHeader.Body);
payload = messageHeader.Body;
}
}
}
Expand Down

0 comments on commit 5347d54

Please sign in to comment.