Skip to content

Instantly share code, notes, and snippets.

View hikalkan's full-sized avatar

Halil İbrahim Kalkan hikalkan

View GitHub Profile
@hikalkan
hikalkan / environment.ts
Created August 20, 2020 13:29
ABP Angular UI v3.1 environment configuration sample
import { Config } from '@abp/ng.core';
const baseUrl = 'http://localhost:4200';
export const environment = {
production: false,
application: {
baseUrl,
name: 'MyProjectName',
logoUrl: '',
@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]
@hikalkan
hikalkan / MyDbContext.cs
Created March 29, 2018 10:51
How to map a dictionary property of an entity to a string field of a table in Entity Framework Core v2.1+
public class MyDbContext : DbContext
{
public DbSet<User> Users { get; set; }
public MyDbContext(DbContextOptions<MyDbContext> options)
: base(options)
{
}
@hikalkan
hikalkan / AllCultures.cs
Last active April 6, 2017 11:13
All culture codes and corresponding Countries.
public static Dictionary<string, string> AllCultures = new Dictionary<string, string>
{
{"af", "Afrikaans"},
{"af-ZA", "Afrikaans - South Africa"},
{"ar", "Arabic"},
{"ar-AE", "Arabic - United Arab Emirates"},
{"ar-BH", "Arabic - Bahrain"},
{"ar-DZ", "Arabic - Algeria"},
{"ar-EG", "Arabic - Egypt"},
{"ar-IQ", "Arabic - Iraq"},
@hikalkan
hikalkan / Log4NetTenantIdProperty.cs
Created March 31, 2017 07:33
How to add a dyanmic tenantid property for log4net
using Abp.Dependency;
using Abp.Runtime.Session;
namespace Abp.Castle.Logging.Log4Net
{
public class Log4NetTenantIdProperty
{
private readonly IIocResolver _iocResolver;
private IAbpSession _session;
@hikalkan
hikalkan / AbpKendoUI.js
Created January 17, 2017 12:37
Kendo UI integration sample for ABP dynamic service proxies
$('#UsersGrid').kendoGrid({
editable: true,
columns: [{
field: 'userName',
title: app.l('UserName')
}, {
field: 'name',
title: app.l('Name')
}, {
field: 'surname',
@hikalkan
hikalkan / ResourceLoader.js
Created December 1, 2016 13:29
Load scripts dynamically.
var app = app || {};
(function ($) {
/* UrlStates enum */
var UrlStates = {
LOADING: 'LOADING',
LOADED: 'LOADED',
FAILED: 'FAILED'
};
@hikalkan
hikalkan / AbpZeroTemplateCoreModule.cs
Last active April 18, 2023 07:37
How to replace IBinaryObjectManager
/* Add registration code to Initialize of your module */
//...
public override void Initialize()
{
IocManager.Register<IBinaryObjectManager, FileSystemBinaryObjectManager>(DependencyLifeStyle.Transient); //ADD THIS HERE
IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly());
}
//...
//Demo usage
public class HomeController : MyControllerBase
{
private readonly IRepository<MyEntity> _myEntityRepository;
public HomeController(IRepository<MyEntity> myEntityRepository)
{
_myEntityRepository = myEntityRepository;
}
@hikalkan
hikalkan / EfPlusDemo-Program.cs
Created July 27, 2016 07:54
EfPlus Demo Soft Delete Filtering with EF Core
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using Microsoft.EntityFrameworkCore;
using Z.EntityFramework.Plus;
namespace EfPlusDemo
{