LemonStudio 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package LemonStudio --version 1.0.0
                    
NuGet\Install-Package LemonStudio -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="LemonStudio" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LemonStudio" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="LemonStudio" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add LemonStudio --version 1.0.0
                    
#r "nuget: LemonStudio, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package LemonStudio@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=LemonStudio&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=LemonStudio&version=1.0.0
                    
Install as a Cake Tool

LemonStudio

LemonStudio 是一个基于 ASP.NET Core 的快速开发框架,提供了完整的用户管理、权限控制、日志记录等功能。

快速开始

安装

dotnet new webapi -n Your.Project -controllers

cd Your.Project

dotnet add package LemonStudio

配置

Program.cs 中添加 LemonStudio 服务:

using FluentValidation;
using Lemon.Services.Extensions;

var builder = WebApplication.CreateBuilder(args);

// 添加 LemonStudio 服务
builder.Services.AddLemonServices(builder.Configuration);

// 添加 OpenApi
builder.Services.AddOpenApi();

// 添加验证器
builder.Services.AddValidatorsFromAssembly(typeof(Program).Assembly);

var app = builder.Build();

if (app.Environment.IsDevelopment())
{
    app.MapOpenApi();
}

// 使用 LemonStudio 中间件
app.UseLemon(app.Environment.IsDevelopment());

app.MapControllers();

app.Run();

配置文件

创建 appsettings.json 配置文件:

{
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft.AspNetCore": "Warning"
    }
  },
  "AllowedHosts": "*",
  "ConnectionStrings": {
    "Database": "Host=localhost;Port=5432;Username=postgres;Password=your-password;Database=your-database;",
    "Redis": "localhost:6379"
  },
  "Database": {
    "Type": "MySQL",
    "ConnectionPool": false,
    "AutoSyncStructure": true
  },
  "Switch": {
    "Admin": true,
    "DataSeed": true
  },
  "Cors": {
    "AllowedOrigins": ["http://localhost:3000", "http://localhost:8080"]
  },
  "Jwt": [
    {
      "Name": "Admin",
      "SecretKey": "your-secret-key-here-must-be-at-least-32-characters",
      "Issuer": "Lemon.Api",
      "Audience": "Lemon.Client",
      "ExpiresInMinutes": 120,
      "SSO": false
    }
  ],
  "Response": {
    "CustomMessages": {
      "2001": "用户不存在",
      "2002": "密码错误",
      "2003": "用户已被禁用",
      "3001": "文件上传失败",
      "3002": "文件格式不支持",
      "3003": "文件大小超出限制",
      "4001": "业务规则验证失败",
      "4002": "数据同步失败",
      "4003": "第三方服务调用失败"
    }
  }
}

许可证

本项目采用 MIT 许可证。

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.4 130 9/1/2025
1.0.3 145 7/9/2025
1.0.2 144 6/30/2025
1.0.1 142 6/23/2025
1.0.0 79 6/21/2025