Skip to content

Instantly share code, notes, and snippets.

@rqx110
rqx110 / EfRepositoryBulkExtensions.cs
Created November 13, 2017 02:33
another abp bulk/batch operation extesion base on http://entityframework-extensions.net
public static class EfRepositoryBulkExtensions
{
public static void BulkInsert<TEntity, TPrimaryKey>(this IRepository<TEntity, TPrimaryKey> repository, IEnumerable<TEntity> entities)
where TEntity : class, IEntity<TPrimaryKey>, new()
{
var dbContext = repository.GetDbContext();
dbContext.BulkInsert(entities);
}
public static async Task BulkInsertAsync<TEntity, TPrimaryKey>(this IRepository<TEntity, TPrimaryKey> repository, IEnumerable<TEntity> entities)
@rqx110
rqx110 / ISqlExecuter.cs
Created September 21, 2017 00:14
abp execute sql command/query and bulkinsert
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Abp.Domain.Entities;
namespace YnTxOA.SqlExecuterInterface
{
public interface ISqlExecuter
@rqx110
rqx110 / untitled.cs
Last active September 13, 2017 03:12
abp增加自定义动态数据过滤
//来自群聊天,因无法贴图片,看comment内容
//具体请参考abp中的MustHaveTenantId实现
//abp代码中搜索SetFilterScopedParameterValue关键字
@rqx110
rqx110 / LoadingProgress.cs
Created August 16, 2017 00:58
winform显示loading图
using System;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
namespace MyControlLibrary
{
public class LoadingProgress : Control
{
@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)
{
@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;
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 / 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;
@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
{