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 AccountController : Controller | |
{ | |
[HttpPost("login")] | |
[AllowAnonymous] | |
[ProducesResponseType(204)] | |
[ProducesResponseType(400)] | |
public async Task<IActionResult> Login([FromBody] LoginPost model) | |
{ | |
var user = await _userManager.FindByEmailAsync(model.Identifier) | |
?? await _userManager.FindByNameAsync(model.Identifier); |
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 AvaCloudUserClientFactory | |
{ | |
public AvaCloudUserClientFactory(string userIdentifier, | |
string userPassword, | |
string avacloudBaseUrl = "https://avacloud-api.dangl-it.com", | |
Func<ITokenStorage> tokenStorageFactory = null) | |
{ | |
_serviceProvider = BuildAvaCloudServiceProvider(userIdentifier, | |
userPassword, | |
avacloudBaseUrl, |
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
services.AddSwaggerDocument(c => | |
{ | |
c.PostProcess = (openApiDocument) => | |
{ | |
var operation = openApiDocument.Paths.Single(p => p.Key.StartsWith("/conversion/gaeb/ava")); | |
var operationParameters = operation.Value.Values.Single().Parameters; | |
var sortedParameters = SortParameters(operationParameters).ToList(); | |
operationParameters.Clear(); | |
foreach (var parameter in sortedParameters) | |
{ |
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 ApiKeyRequirement : IAuthorizationRequirement | |
{ | |
public IReadOnlyList<string> ApiKeys { get; set; } | |
public ApiKeyRequirement(IEnumerable<string> apiKeys) | |
{ | |
ApiKeys = apiKeys?.ToList() ?? new List<string>(); | |
} | |
} |
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
<?xml version="1.0" encoding="utf-8"?> | |
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" | |
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | |
xmlns:prism="clr-namespace:Prism.Mvvm;assembly=Prism.Forms" | |
prism:ViewModelLocator.AutowireViewModel="True" | |
x:Class="App.Mobile.Views.HackyReportPage" | |
Title="Hacky Chart.js Report"> | |
<WebView VerticalOptions="FillAndExpand"> | |
<WebView.Source> | |
<HtmlWebViewSource Html="{Binding ReportHtml}" /> |
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
#begin[GAEB] | |
#begin[_Dangl] | |
[_Info]Created with Dangl GAEB Tool, Copyright 2013 - 2018 Georg Dangl, www.dangl-it.com, Version 1.4.15.0 (Built: 11.01.2018 16:13)[end] | |
#end[_Dangl] | |
#begin[GAEBInfo] | |
[Version]1.2[end] | |
[VersMon]11[end] | |
[VersJahr]2001[end] | |
[Datum]17.02.2018[end] | |
[Uhrzeit]11:07[end] |
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
services.AddMvc() | |
// This allows to exclude some assembly from controller discovery | |
.ConfigureApplicationPartManager(a => | |
{ | |
var appPart = a.ApplicationParts.FirstOrDefault(ap => ap.Name == "Assembly.Name"); | |
if (appPart != null) | |
{ | |
a.ApplicationParts.Remove(appPart); | |
} | |
}) |
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
namespace Project.SpaExtensions | |
{ | |
public interface IUserLanguageService | |
{ | |
string GetUserLocale(); | |
} | |
} |
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
using Xunit; | |
// This is required to have the IAssemblyFixture from the Xunit.Extensions.Ordering Package available | |
[assembly: TestFramework("Xunit.Extensions.Ordering.TestFramework", "Xunit.Extensions.Ordering")] |
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
protected override void OnModelCreating(ModelBuilder builder) | |
{ | |
base.OnModelCreating(builder); | |
if (Database.ProviderName == "Microsoft.EntityFrameworkCore.Sqlite") | |
{ | |
// SQLite does not have proper support for DateTimeOffset via Entity Framework Core, see the limitations | |
// here: https://docs.microsoft.com/en-us/ef/core/providers/sqlite/limitations#query-limitations | |
// To work around this, when the Sqlite database provider is used, all model properties of type DateTimeOffset | |
// use the DateTimeOffsetToBinaryConverter |
NewerOlder