Skip to content

Instantly share code, notes, and snippets.

View hikalkan's full-sized avatar

Halil İbrahim Kalkan hikalkan

View GitHub Profile
@hikalkan
hikalkan / INotificationManager.cs
Created January 14, 2016 11:44
A persistent notification manager interface draft (to be added to ABP)
public interface INotificationManager
{
/// <summary>
/// Subscribes a user to a notificationName for any event.
/// </summary>
void Subscribe(long userId, string notificationName);
/// <summary>
/// Subscribes a user to a notificationName for events on specific Entity type.
/// </summary>
@hikalkan
hikalkan / AbpZeroDbModelBuilderExtensions.cs
Created March 2, 2016 12:54
Change prefix ABP tables.
using System.Data.Entity;
using Abp.Application.Editions;
using Abp.Application.Features;
using Abp.Auditing;
using Abp.Authorization;
using Abp.Authorization.Roles;
using Abp.Authorization.Users;
using Abp.BackgroundJobs;
using Abp.Configuration;
using Abp.Localization;
@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
using System;
using System.IO;
using System.Linq;
using System.Text;
namespace AbpWebSite.Templates
{
/// <summary>
/// Used to rename a solution
/// </summary>
@hikalkan
hikalkan / AbpSessionExtensions.cs
Created June 20, 2016 16:06
Creating an overridable session for ABP
using System;
using Abp.Runtime.Session;
namespace Abp.Temp
{
public static class AbpSessionExtensions
{
public static IDisposable Override(this IAbpSession abpSession, int? tenantId, long? userId)
{
var overridableSession = abpSession as OverridableSession;
@hikalkan
hikalkan / MyJob1Class.cs
Created July 12, 2016 11:01
Example usage of HangFire's RecurringJob in ABP
using Abp.Dependency;
using Castle.Core.Logging;
namespace Halil.HangfireTests.Web.Controllers
{
public class MyJob1Class : ITransientDependency
{
private readonly ILogger _logger;
public MyJob1Class(ILogger logger)
@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
{
//Demo usage
public class HomeController : MyControllerBase
{
private readonly IRepository<MyEntity> _myEntityRepository;
public HomeController(IRepository<MyEntity> myEntityRepository)
{
_myEntityRepository = myEntityRepository;
}
@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());
}
//...
@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'
};