Mizekar.Common
1.0.74
dotnet add package Mizekar.Common --version 1.0.74
NuGet\Install-Package Mizekar.Common -Version 1.0.74
<PackageReference Include="Mizekar.Common" Version="1.0.74" />
<PackageVersion Include="Mizekar.Common" Version="1.0.74" />
<PackageReference Include="Mizekar.Common" />
paket add Mizekar.Common --version 1.0.74
#r "nuget: Mizekar.Common, 1.0.74"
#:package Mizekar.Common@1.0.74
#addin nuget:?package=Mizekar.Common&version=1.0.74
#tool nuget:?package=Mizekar.Common&version=1.0.74
Mizekar.Common
کتابخانه مشترک برای تمام پروژههای بکاند Mizekar که شامل قابلیتهای مشترک مانند Logging، Swagger، Middleware، Exception Handling، Authentication، Permissions، Features و Helper classes میباشد.
مستندات کامل agent: ../docs/overview.md (فهرست ماژولها، recipes، decision trees).
ساختار پروژه
Mizekar.Common/
├── Authentication/ # Authentication services (ICurrentUser, ICurrentWorkSpace, RequireAdminAttribute)
├── Exceptions/ # Exception classes و Global Exception Handler
├── Extensions/ # Extension methods (DateTime, IQueryable, Strings, ServiceCollection)
├── Features/ # Feature management (IFeatureService, RequireFeatureAttribute)
├── Helpers/ # Helper classes (FinancialNumberToWords, FormulaEval, ExportFiles)
├── Logging/ # Logging configuration و Middleware
├── Middleware/ # Custom middleware (Culture, ModelValidation, UserAndWorkSpaceHeader)
├── Permissions/ # Permission management (IPermissionService, RequirePermissionAttribute)
├── Security/ # Security services (ISecurityService)
└── Swagger/ # Swagger configuration extensions
نحوه استفاده
راهنمای Program
اگر میخواهید بدانید پروژههای دیگر باید Mizekar.Common را در Program.cs چطور مصرف کنند، این راهنما را ببینید:
1. اضافه کردن Reference
در فایل .csproj پروژه خود:
<ItemGroup>
<ProjectReference Include="..\..\mizekar-common\Mizekar.Common\Mizekar.Common.csproj" />
</ItemGroup>
2. استفاده در Program.cs
using Autofac;
using Mizekar.Common.Logging;
using Mizekar.Common.Extensions;
using Mizekar.Common.Swagger;
using Mizekar.Common.Data;
var builder = WebApplication.CreateBuilder(args);
builder.Host.UseMizekarAutofac(new[]
{
typeof(Program).Assembly,
typeof(Mizekar.Common.Extensions.ServiceCollectionExtensions).Assembly
}, builder =>
{
builder.RegisterType<YourDbContext>().As<IUnitOfWork>().InstancePerLifetimeScope();
});
// Configure centralized logging
builder.Host.UseMizekarLogging("ServiceName");
// Add common services
builder.Services.AddMizekarCommonServices();
// Required when controllers are resolved through DI and use property injection
builder.Services.AddControllers().AddControllersAsServices();
// Add Swagger
builder.Services.AddMizekarSwagger(
title: "API Title",
description: "API Description"
);
var app = builder.Build();
// Use Swagger
app.UseMizekarSwagger(routePrefix: "swagger");
// Use shared middleware pipeline
app.UseMizekarSharedPipeline();
نکته: اگر از PropertiesAutowired() استفاده میکنید، پراپرتیهای injectable باید set داشته باشند، نه init.
قابلیتها
Authentication
ICurrentUserوCurrentUser: مدیریت اطلاعات کاربر فعلیICurrentWorkSpaceوCurrentWorkSpace: مدیریت workspace فعلیRequireAdminAttribute: Attribute برای محدود کردن دسترسی به admin
Permissions
IPermissionService: بررسی permission و role از authorization snapshot درخواستRequirePermissionAttribute: Attribute برای اعمال permission check- جزئیات معماری: Runtime authorization snapshots
Features
IFeatureService: بررسی feature و limit از snapshot درخواست که مستقیماً از Subscription دریافت میشودRequireFeatureAttribute: Attribute برای اعمال feature check
Security
ISecurityService: سرویس برای hash و GUID generation
Helpers
FinancialNumberToWords: تبدیل عدد به کلمات فارسیFormulaEval: ارزیابی فرمولهای ریاضی به صورت امنExportFiles: Export به Excel و PDF
Extensions
DateTimeExtensions: Parse تاریخ شمسی/میلادیDateTimeOffsetExtensions: تبدیل به زمان ایرانIQueryableExtensions: WhereIf و OrderBy2StringsExtensions: تبدیل اعداد فارسی/انگلیسی، GenerateCode، GenerateSlug
Dependencies
- Microsoft.AspNetCore.App
- Serilog.AspNetCore (8.0.1)
- Swashbuckle.AspNetCore (7.3.1)
- MiniExcelLibs (1.38.0)
- DynamicExpresso.Core (2.19.2)
License
Proprietary - Mizekar
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- Autofac (>= 9.3.1)
- Autofac.Extensions.DependencyInjection (>= 11.0.2)
- AutoMapper (>= 16.2.0)
- AWSSDK.S3 (>= 4.0.101.2)
- DynamicExpresso.Core (>= 2.19.3)
- MassTransit.EntityFrameworkCore (>= 8.5.10)
- MassTransit.RabbitMQ (>= 8.5.10)
- Microsoft.EntityFrameworkCore (>= 10.0.10)
- Microsoft.EntityFrameworkCore.Relational (>= 10.0.10)
- Microsoft.Extensions.Caching.StackExchangeRedis (>= 10.0.10)
- Microsoft.IdentityModel.JsonWebTokens (>= 8.14.0)
- MiniExcel (>= 1.45.0)
- Mizekar.Contracts (>= 1.0.3)
- Npgsql.EntityFrameworkCore.PostgreSQL (>= 10.0.3)
- Serilog.AspNetCore (>= 10.0.0)
- Serilog.Enrichers.ExceptionProperties (>= 2.0.0)
- Serilog.Sinks.Console (>= 6.1.1)
- Serilog.Sinks.Debug (>= 3.0.0)
- Serilog.Sinks.Seq (>= 9.1.0)
- Swashbuckle.AspNetCore (>= 10.2.3)
- System.Linq.Dynamic.Core (>= 1.7.3)
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.74 | 89 | 8/30/2026 |
| 1.0.73 | 97 | 8/30/2026 |
| 1.0.71 | 101 | 8/29/2026 |
| 1.0.70 | 103 | 8/29/2026 |
| 1.0.62 | 85 | 8/26/2026 |
| 1.0.60 | 105 | 8/24/2026 |
| 1.0.59 | 94 | 8/24/2026 |
| 1.0.58 | 106 | 8/24/2026 |
| 1.0.57 | 92 | 8/24/2026 |
| 1.0.56 | 96 | 8/24/2026 |
| 1.0.55 | 111 | 8/22/2026 |
| 1.0.54 | 107 | 8/21/2026 |
| 1.0.53 | 99 | 8/20/2026 |
| 1.0.52 | 153 | 8/12/2026 |
| 1.0.51 | 98 | 8/12/2026 |
| 1.0.50 | 127 | 8/9/2026 |
| 1.0.49 | 139 | 8/4/2026 |
| 1.0.48 | 102 | 8/4/2026 |
| 1.0.47 | 114 | 8/3/2026 |
| 1.0.46 | 127 | 8/3/2026 |