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 static class AttributeInjector | |
| { | |
| public static void AddInjectionByAttribute(this IServiceCollection services) | |
| { | |
| RegisterWithAttribute(ref services, typeof(InjectableSingletonAttribute)); | |
| RegisterWithAttribute(ref services, typeof(InjectableTransientAttribute)); | |
| RegisterWithAttribute(ref services, typeof(InjectableScopedAttribute)); | |
| } | |
| private static void RegisterWithAttribute(ref IServiceCollection services, Type injectableAttribute) |
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
| [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] | |
| public class InjectableTransientAttribute : Attribute | |
| { | |
| } | |
| [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] | |
| public class InjectableScopedAttribute : Attribute | |
| { | |
| } |
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 void ConfigureServices(IServiceCollection services) | |
| { | |
| services.AddDbContext<ApplicationDbContext>(options => | |
| options.UseInMemoryDatabase() | |
| ); | |
| // Add framework services. | |
| services.AddMvc(); | |
| // Register application services. |
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
| version: '0.1.2-beta-{build}' | |
| platform: Any CPU | |
| configuration: Release | |
| os: Visual Studio 2017 | |
| before_build: | |
| - dotnet restore | |
| - dotnet restore .\NetCoreTeamCity.Tests |
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
| after_build: | |
| - dotnet pack ".\NetCoreTeamCity\NetCoreTeamCity.csproj" -c %CONFIGURATION% -o ..\artifacts | |
| artifacts: | |
| - path: artifacts\**\*.* | |
| deploy: | |
| provider: NuGet | |
| api_key: | |
| secure: Fec5HdqiA0Akjsvv03vBNhcc1bSEtrOBNfLTcP5tL6LM/s++ra9EltKovDC3Mn3x | |
| skip_symbols: false | |
| artifact: /.*\.nupkg/ |
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
| param( | |
| [string] | |
| $ResultsFile, | |
| [string] | |
| $ResultsType = "mstest" | |
| ) | |
| $ResultsFile = Resolve-Path $ResultsFile | |
| $Url = "https://ci.appveyor.com/api/testresults/$ResultsType/$($env:APPVEYOR_JOB_ID)" |
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
| test_script: | |
| - dotnet test ".\NetCoreTeamCity.Tests\NetCoreTeamCity.Tests.csproj" -c %CONFIGURATION% --logger:trx;LogFileName=tests-results01.xml | |
| - ps: .\build\uploadtests.ps1 ".\NetCoreTeamCity.Tests\TestResults\tests-results01.xml" |
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
| version: '0.1.2-beta-{build}' | |
| platform: Any CPU | |
| configuration: Release | |
| os: Visual Studio 2017 | |
| before_build: | |
| - dotnet restore | |
| - dotnet restore .\NetCoreTeamCity.Tests |
NewerOlder