Skip to content

Instantly share code, notes, and snippets.

View hikalkan's full-sized avatar

Halil İbrahim Kalkan hikalkan

View GitHub Profile
@hikalkan
hikalkan / SingletonsDependingScoped.cs
Created June 28, 2019 14:25
Some tests shows how to use scoped services from singleton services
using System;
using Microsoft.Extensions.DependencyInjection;
using Shouldly;
using Xunit;
namespace MsDependencyInjectionTests
{
public class SingletonsDependingScoped
{
[Fact]
//Demo usage
public class HomeController : MyControllerBase
{
private readonly IRepository<MyEntity> _myEntityRepository;
public HomeController(IRepository<MyEntity> myEntityRepository)
{
_myEntityRepository = myEntityRepository;
}

How To: Setting up ASPNetZero With Modular Application

Preparing AspNetZero Project

  1. Create a github repo "jpy-d360"

    clone the above create repo to working directory

  2. Get the latest version of AspNetZero Binary

    Company name : "JPY" Project name : "Zero"

@hikalkan
hikalkan / MyDbContextTypeMatcher.cs
Last active June 11, 2016 20:48
DbContextTypeMatcher test
using System;
using System.Collections.Generic;
using System.Linq;
using Abp.Collections.Extensions;
using Abp.Dependency;
using Abp.Domain.Uow;
using Abp.EntityFramework.Repositories;
using Abp.MultiTenancy;
namespace Abp.EntityFramework
@cwe1ss
cwe1ss / Startup.cs
Last active November 25, 2021 10:57
Castle.Facilities.AspNetCoreIntegration
public IServiceProvider ConfigureServices(IServiceCollection services)
{
// Configure regular ASP.NET Core services
services.AddMvc();
// ...
// Send configuration to Castle Windsor
Container.Populate(services);
Container.BeginScope();
return Container.Resolve<IServiceProvider>();
@hikalkan
hikalkan / CallApiFromConsole-Program.cs
Last active August 16, 2022 22:16
This code shows how to login to an ASP.NET ZERO (http://aspnetzero.com) based application and call an application service method remotely.
using System;
using System.Net;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using Abp;
using Abp.Application.Services.Dto;
using Abp.Dependency;
using Abp.Domain.Entities.Auditing;
using Abp.Extensions;