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
<!-- icon.svg has with and viewbox attributes. They should work fine --> | |
<svg | |
xmlns="http://www.w3.org/2000/svg" | |
xmlns:xlink="http://www.w3.org/1999/xlink" | |
width="250px" | |
viewBox="0 0 1952.00 734.93" | |
enable-background="new 0 0 1952.00 734.93" | |
xml:space="preserve"> | |
... | |
</svg> |
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
using ApplicationCore.Extensions; | |
namespace UnitTests.ApplicationCore.Extensions | |
{ | |
[Service(typeof(IMockClassForExtensionsTestsA), Lifetime.Transient)] | |
public class MockClassForExtensionsTestsA : IMockClassForExtensionsTestsA | |
{ } | |
public interface IMockClassForExtensionsTestsA | |
{ } |
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
using Xunit; | |
using FluentAssertions; | |
using Microsoft.Extensions.DependencyInjection; | |
using ApplicationCore.Extensions; | |
namespace UnitTests.ApplicationCore.Extensions | |
{ | |
public class ServiceCollectionExtensionsTest | |
{ | |
private readonly IServiceCollection _serviceCollection; |
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
// Add attribute | |
// Interface for the class & Lifetime | |
// (1) Scoped | |
[Service(typeof(IAppsRepository), Lifetime.Scoped)] | |
public class AppsRepository : IAppsRepository | |
{ | |
... | |
} | |
// (2) Transient |
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) | |
{ | |
// Add dependencies manually | |
services.AddScoped(typeof(IAppLogger<>), typeof(LoggerAdapter<>)); | |
services.AddScoped(typeof(IEfRepository<>), typeof(EfRepository<>)); | |
services.AddScoped<IAppsRepository, AppsRepository>(); | |
services.AddScoped<IAppReviewRepository, AppReviewRepository>(); | |
services.AddScoped<IAppCategoryRespository, AppCategoryRespository>(); | |
... | |
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) | |
{ | |
// Add dependencies with extension methods | |
services.AddClassesWithServiceAttribute("ApplicationCore"); | |
services.AddClassesWithServiceAttribute("Infrastructure"); | |
services.AddClassesWithServiceAttribute("Web"); | |
// AddMvc for controllers | |
services.AddMvc() | |
} |
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
/* | |
* Based on Habitat | |
* https://github.com/Sitecore/Habitat/tree/master/src/Foundation/DependencyInjection/code | |
*/ | |
using System; | |
using System.Collections.Generic; | |
using System.Globalization; | |
using System.Linq; | |
using System.Reflection; |
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
using System; | |
namespace ApplicationCore.Extensions | |
{ | |
public enum Lifetime | |
{ | |
Transient, | |
Singleton, | |
Scoped | |
} |
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
[{ | |
"relation": ["delegate_permission/common.handle_all_urls"], | |
"target": { | |
"namespace": "android_app", | |
"package_name": "com.mydatahack.firstapp", | |
"sha256_cert_fingerprints": | |
["sha from app sigining in GooglePlay console for 1st app"] | |
} | |
}, | |
{ |
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
<!-- For the first app --> | |
<resources> | |
<string name="app_name">My First App</string> | |
<string name="asset_statements"> | |
[{ | |
\"relation\": [\"delegate_permission/common.handle_all_urls\"], | |
\"target\": { | |
\"namespace\": \"web\", | |
\"site\": \"https://mygithubusername.github.io\"} | |
}] |