Skip to content

Instantly share code, notes, and snippets.

View maliming's full-sized avatar
🏠
Working from home

maliming

🏠
Working from home
View GitHub Profile
public class SeedTestDataTestBaseModule : AbpModule
{
private static readonly SemaphoreSlim Semaphore = new SemaphoreSlim(1, 1);
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
SeedTestData(context);
}
private static void SeedTestData(ApplicationInitializationContext context)
@maliming
maliming / Program.cs
Created October 10, 2023 05:40
Update volo packages based on abp.
using System.Text;
using System.Text.RegularExpressions;
using System.Xml.Linq;
var abpPackages = new Dictionary<string, string>();
var csprojFiles = Directory.GetFiles("C:\\Github\\Volosoft\\abp", "*.csproj", SearchOption.AllDirectories);
foreach (var csprojFile in csprojFiles)
{
var csproj = XDocument.Load(csprojFile);
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
@maliming
maliming / ConfigureShareCultureCookies.cs
Created March 1, 2023 02:39
ConfigureShareCultureCookies
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.ConfigureShareCultureCookies();
}
app.UseCookiePolicy();
public static class ShareCultureCookiesServiceCollectionExtensions
{
var i = 1;
var timer = new AsyncTimer(1000, false)
{
Callback = async (timer, token) =>
{
Console.WriteLine(i++);
if (i > 5)
{
using System;
using System.Collections.Generic;
using Abp.Application.Services;
using Abp.AspNetCore.Configuration;
using Abp.Extensions;
using Castle.Windsor.MsDependencyInjection;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.ApplicationModels;
using Microsoft.Extensions.DependencyInjection;
using System.Linq;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using Microsoft.IdentityModel.Tokens;
using Volo.Abp.Text.Formatting;
using LogHelper = Microsoft.IdentityModel.Logging.LogHelper;
namespace MyCompanyName.MyProjectName
{
using System;
using Microsoft.AspNetCore.Mvc;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo
{
[Area("Test")]
[Route("Test/[action]")]
public class TestController : AbpController, IRemoteService
{
[HttpGet]
@maliming
maliming / test.js
Last active November 21, 2020 12:59
// module test
(function(){
// controller volo.abp.aspNetCore.mvc.uI.bootstrap.demo.test
(function(){
abp.utils.createNamespace(window, 'volo.abp.aspNetCore.mvc.uI.bootstrap.demo.test');
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using JetBrains.Annotations;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Abstractions;
using Microsoft.AspNetCore.Mvc.ApiExplorer;
using Microsoft.AspNetCore.Mvc.ModelBinding;