Skip to content

Instantly share code, notes, and snippets.

@rqx110
rqx110 / HomeController.cs
Last active March 9, 2018 03:46 — forked from hikalkan/HomeController.cs
扩展IRepository,支持批量插入
//Demo usage
public class HomeController : MyControllerBase
{
private readonly IRepository<MyEntity> _myEntityRepository;
public HomeController(IRepository<MyEntity> myEntityRepository)
{
_myEntityRepository = myEntityRepository;
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Web.Mvc;
namespace BusinessMQ.Core
{
/// <summary>
@rqx110
rqx110 / AbpSessionExtensions.cs
Created November 24, 2016 05:11 — forked from hikalkan/AbpSessionExtensions.cs
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;
public class CustomerMySqlMigrationSqlGenerator : MySqlMigrationSqlGenerator
{
public override IEnumerable<MigrationStatement> Generate(IEnumerable<MigrationOperation> migrationOperations, string providerManifestToken)
{
var otherMigrationOperations = new List<MigrationOperation>();
var statements = new List<MigrationStatement>();
foreach (var op in migrationOperations)
{
var migration = op as AlterTableOperation;
if (migration != null)
@rqx110
rqx110 / ControlExtension.cs
Created March 31, 2017 06:21
在创建控件的线程上调用方法
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace System.Windows.Forms
{
public static class ControlExtension
{
@rqx110
rqx110 / AbpZeroDbContext_MySql.cs
Last active April 18, 2017 08:35
another using MySql in Abp
using System.Data.Common;
using System.Data.Entity;
using Abp.Zero.EntityFramework;
using Microsoft.Extensions.Configuration;
using AlanFlaherty.AdminPanelCore.Authorization.Roles;
using AlanFlaherty.AdminPanelCore.Configuration;
using AlanFlaherty.AdminPanelCore.MultiTenancy;
using AlanFlaherty.AdminPanelCore.Users;
using AlanFlaherty.AdminPanelCore.Web;
using MySql.Data.MySqlClient;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MyApp.Hmac
{
public static class AuthenticationConstants
{
@rqx110
rqx110 / SplashForm.cs
Created June 20, 2017 02:51
show splash form for winform app
namespace Bootstrap
{
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Threading;
using System.Windows.Forms;
@rqx110
rqx110 / RandomIdGenerator.cs
Created July 24, 2017 08:02
Base 62 ID generator
public static class RandomIdGenerator
{
private static char[] _base62chars =
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
.ToCharArray();
private static Random _random = new Random();
public static string GetBase62(int length)
{