Code Monkey home page Code Monkey logo

masa.framework's Introduction

| EN

codecov Quality Gate Status

MASA.Framework

.NET next-generation microservice development framework, which provides cloud native best practices based on Distributed Application Runtime--Dapr, which can quickly realize modern application development such as distributed, microservices, DDD, SaaS, etc.

Framework

Docs

https://docs.masastack.com/framework/concepts/overview

route map

Features

The following are the building block abilities provided by the Framework:

feature.png

Quick use

Prerequisites

Install Template

dotnet new --install Masa.Template

Create Project

dotnet new masafx -o Masa.Framework.Demo

Or Use the MASA Framework Project template to create through Visual Studio

Run

dotnet run

How to contribute

  1. Fork & Clone
  2. Create Feature_xxx branch
  3. Commit with commit message, like feat(Isolation): Support physical isolation, logical isolation
  4. Create Pull Request

If you wish to contribute, please Pull Request, or send us a Report Bug .

Contributors

Thanks to all the friends who have contributed to this project.

Code of conduct

This project adopts the Code of Conduct as defined by the Contributors Covenant to clarify the expected behavior of our community. For more information see MASA Stack Community Code of Conduct.

☀️ License Statement

MASA.Framework

Copyright (c) 2021-present MASA Stack

masa.framework's People

Contributors

239573049 avatar akinix avatar blazor-component avatar capdiem avatar codding-y avatar doddgu avatar duiapro avatar gavin1ee avatar ihuangxing avatar kogel-net avatar maplewithoutwords avatar masastack-opensource avatar mayuecif avatar mixvii avatar pollosd avatar qinxh avatar qinyouzeng avatar somck avatar wuweilaiya avatar wzh425 avatar xiaolipro avatar xiaoxiaotank avatar xyfy avatar zhenlei520 avatar zyz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

masa.framework's Issues

直接关闭 VS 或者程序 dapr 边车没有退出

Description

5bbf057b2b22d4b5a8b77caee3e4358

Environment

.Net SDK Version:

.NET SDK:
 Version:   8.0.100-preview.1.23115.2
 Commit:    913e4679b3

.NET SDKs installed:
  6.0.310 [C:\Program Files\dotnet\sdk]
  7.0.300-preview.23122.5 [C:\Program Files\dotnet\sdk]
  8.0.100-preview.1.23115.2 [C:\Program Files\dotnet\sdk]

MASA Framework Version:

<ItemGroup>
  <PackageReference Include="Dapr.AspNetCore" Version="1.10.0" />
  <PackageReference Include="Masa.Contrib.Development.DaprStarter.AspNetCore" Version="1.0.0-preview.19" />
</ItemGroup>

Demo

个人习惯直接使用集成终端操作,会直接停止应用程序,所以可能会容易重现这个问题

image

MASA.Contrib Roadmap for 0.4.0

Roadmap

This issue represents a list of major investments that our team will focus on in the 0.4.0 time frame. It doesn't include all the features and bug fixes we'll be working on in the meantime
这个Issue代表我们团队将在 0.4.0 内重点关注的列表。它不包括我们将在此期间进行的所有功能和错误修复。

Note that this is an aspirational list of what we hope to get to. Many of these items will require thorough investigation and design, which can result in changes to our plans. We will end up cutting some things and making changes as we go, but will try to keep this issue up to date to reflect on our progress and learnings.
请注意,这是一个我们希望达到的愿望清单。 其中许多项目需要彻底的调查和设计,这可能会导致我们的计划发生变化。我们最终可能会消减一些东西,并做出改变,但将努力保持这个Issue是最新的,以反映我们的进步和学习。

The roadmap consists of the following features:
路线图包括以下特性

AutoComplete(自动完成)

  • Add document operation(get, set, delete)
    添加document操作(get, set, delete)

Configuration(配置)

  • Add IMasaConfiguration to support get the Configuration from the local configuration and configuration api
    添加 IMasaConfiguration 支持从本地配置和配置ApiI中获取配置 #36

Ddd.Domain(领域)

  • AggregateRoot support domain events #55
    聚合根支持领域事件

Isolation(隔离性)

  • Isolation support physical, logical and tenant #28 #30 #31
    隔离性支持物理的, 逻辑的, 租户
  • Support environmen isolation #28 #30 #31
    支持环境隔离

Mapping(映射)

  • Support Mapping.Mapster #50 #51
    支持Mapping.Mapster

Default Environment Parser Tweaks

The original default environment parsers were seven, and their order was

  • HttpContextItemParserProvider: Get environment information through the Items property of the requested HttpContext
  • QueryStringParserProvider: Get environment information through the requested QueryString https://github.com/masastack?ASPNETCORE_ENVIRONMENT=development (environment information is development)
  • FormParserProvider: Get environment information through Form form
  • RouteParserProvider: Get environment information through routing
  • HeaderParserProvider: Get environment information through request headers
  • CookieParserProvider: Get environmental information through cookies
  • EnvironmentVariablesParserProvider: Get environment information through system environment variables

The new environment parser is adjusted to:

  • HttpContextItemParserProvider: Get environment information through the Items property of the requested HttpContext
  • QueryStringParserProvider: Get environment information through the requested QueryString https://github.com/masastack?ASPNETCORE_ENVIRONMENT=development (environment information is development)
  • FormParserProvider: Get environment information through Form form
  • RouteParserProvider: Get environment information through routing
  • HeaderParserProvider: Get environment information through request headers
  • CookieParserProvider: Get environmental information through cookies
  • MasaAppConfigureParserProvider: Get environment information through global configuration
  • EnvironmentVariablesParserProvider: Get environment information through system environment variables

IntegrationEvent持久化主键

  1. integrationeventlog中使用无序的GUID作为主键,可能为影响持久化数据库性能,建议抽象一个ID生成接口,框架使用者可以自行定义
  2. 对于服务拆分比较简陋的情况下,可能存在多个服务器公用数据库的问题,建立integrationeventlog增加应用ID或名称用于区分应用

异步PublishAsync触发的Handler中无法再次PublishAsync

模块: Dispatcher.Event

场景: 在业务处理中,存在某些耗时操作,当请求到达后,直接触发处理,然后返回请求端成功,并且在耗时操作中涉及事件触发;

Code:

// controller
app.MapGet("/publish", async ([FromServices] IEventBus eventBus) =>
{
    return eventBus.PublishAsync(new Event1());
});

// handler
// 存在耗时操作,并且会继续PublishAsync
[EventHandler]
public async Task Handler(Event1 e1)
{
    await Task.Delay(4000);
    await _eventBus.PublishAsync(new Event2());
}

异常:

fail: Masa.Contrib.Dispatcher.Events.DefaultExceptionStrategyProvider[0]
      ----- Error Publishing event Event1 { }: after 0th executions and we will stop retrying. message id: d9d4fe5d-4ef6-4155-b036-edd701668edd -----
      System.ObjectDisposedException: Cannot access a disposed object.
      Object name: 'IServiceProvider'.
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.ThrowHelper.ThrowObjectDisposedException()
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
         at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
         at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
         at Masa.Contrib.Dispatcher.Events.EventBus.PublishAsync[TEvent](TEvent event)
         at Masa.Dispatcher.Test.Event1Handler.Handler(Event1 e1) in D:\Workspace\Test\Masa.Dispatcher.Test\Masa.Dispatcher.Test\Event1Handler.cs:line 21
         at Masa.Contrib.Dispatcher.Events.EventHandlerAttribute.ExcuteAction[TEvent](IServiceProvider serviceProvider, TEvent event)
         at Masa.Contrib.Dispatcher.Events.Internal.Dispatch.DispatcherBase.<>c__DisplayClass7_0`1.<<ExecuteEventHandlerAsync>b__0>d.MoveNext()
      --- End of stack trace from previous location ---
         at Masa.Contrib.Dispatcher.Events.Strategies.ExecutionStrategy.ExecuteAsync[TEvent](StrategyOptions strategyOptions, TEvent event, Func`2 func, Func`4 cancel) 

期望: 在PublishAsync我可以选择等待处理完成,也可以在触发事件后让事件处理在后台异步执行;

The CreationTime property cannot be customized to modify the value

Description

The CreationTime is initialized in AuditAggregateRoot. I wrote the method of modifying the time in the inherited class. The last time to write to the database is not the seed time, but the time when the framework is initialized.

132f50b25ef90c89558286363b50fe1

This is the value that comes up when debugging:

edd17dc49aee74d3b134be92e27daef

The value inserted by the database is not the expected seed data time, but the current system time when the data was created:

bc21c7533ac47dad39c353a619505a7

Reproduction Steps

No response

Expected behavior

Can customize and modify CreationTime

Actual behavior

CreationTime cannot be customized

Known Workarounds

No response

.NET version

.NET 8 Preview 3

MASA Framework version

1.0.0-preview.28

Other information

No response

Publish Integration Events Errors in Isolation

Description

The multi-tenant and multi-environment information is not marked when publishing the integration event, resulting in the inability of the subscriber to correctly obtain the data context, cache context, storage context, etc.

Reproduction Steps

No response

Expected behavior

Subscribers of integration events need to normally obtain the corresponding data context, cache context, storage context and other component contexts that support isolation

Actual behavior

No response

Known Workarounds

No response

.NET version

.NET 6.0

MASA Framework version

1.0.0-preview.27

Other information

No response

MultilevelCache同时设置滑动过期及绝对过期后调用RefreshAsync报错

错误重现:

Set一个缓存,绝对过期设置3分钟,滑动过期设置1分钟。在2分钟内调用RefreshAsync会正常执行,在2分钟后再调用RefreshAsync就会报错,具体错误如下:
ERR Error running script(call to f_eee8e8411e108ddb82c33faf93d850ef6e75b272): @user_script:2: ERR value is not an integer or out of range

wasm引用Masa.Contrib.Service.Caller.HttpClient出现RuntimeIdentifier“browser-wasm”问题

只要wasm有引用的项目使用了Masa.Contrib.Service.Caller.HttpClient这个包,会导致wasm项目出现NETSDK1082 Microsoft.AspNetCore.App 没有运行时包可用于指定的 RuntimeIdentifier“browser-wasm”。可能Masa.Contrib.Service.Caller.HttpClient这个包出现有与BlazorWebAssembly不兼容的引用导致,下面提供复现demo,希望能检查一下Masa.Contrib.Service.Caller.HttpClient这个包。
MasaTest.zip

The class of the integration event cannot be modified

Description

The class of the integration event cannot be modified, and the modification will cause an error in sending the integration event

Topic and integration event are one-to-one, but the name of the integration event should not affect this

.NET version

.NET 6.0

MasaDbContext doesn't support redefining QueryTrackingBehavior

Description

Custom QueryTrackingBehavior is not supported in custom Context

public class CustomQueryDbContext : MasaDbContext<CustomQueryDbContext>
{
    public CustomQueryDbContext(MasaDbContextOptions<CustomQueryDbContext> options) : base(options)
    {
        ChangeTracker.QueryTrackingBehavior = QueryTrackingBehavior.TrackAll;
    }
}

Reproduction Steps

No response

Expected behavior

No response

Actual behavior

No response

Known Workarounds

No response

.NET version

0.6.0

MASA Framework version

1.0.0-preview.26

Other information

No response

MASA.Contrib Roadmap for 0.5.0

Roadmap

This issue represents a list of major investments that our team will focus on in the 0.5.0 time frame. It doesn't include all the features and bug fixes we'll be working on in the meantime
这个Issue代表我们团队将在 0.5.0 内重点关注的列表。它不包括我们将在此期间进行的所有功能和错误修复。

Note that this is an aspirational list of what we hope to get to. Many of these items will require thorough investigation and design, which can result in changes to our plans. We will end up cutting some things and making changes as we go, but will try to keep this issue up to date to reflect on our progress and learnings.
请注意,这是一个我们希望达到的愿望清单。 其中许多项目需要彻底的调查和设计,这可能会导致我们的计划发生变化。我们最终可能会消减一些东西,并做出改变,但将努力保持这个Issue是最新的,以反映我们的进步和学习。

The roadmap consists of the following features:
路线图包括以下特性

Parser(解析器)

  • There are 6 parsers supported by default: HttpContextItemParser、QueryStringParser、FormParser、RouteParser、HeaderParser、CookieParser
    默认支持6种解析器: HttpContextItemParser、QueryStringParser、FormParser、RouteParser、HeaderParser、CookieParser

Identity(身份)

  • Provide access to user identity information
    提供获取用户身份信息

IdGenerator

  • Support IdGenerator
    支持IdGenerator

MinimalAPIs

  • Planning
    规划中

Observability(可观测性)

  • Support OpenTelemetry
    支持OpenTelemetry

Rule Engine(规则引擎)

  • Planning
    规划中

IUnitOfWork 注入 API 设计不太友好

背景

准备用 MASA.Framework 实现一个有关用户的 CURD 接口服务。

问题

定义了 UserRepository 继承了 Repository 的实现

image

并在 Program 注入了该仓储以及 DbContext

image

当我启动的时候,会抛异常缺少依赖 IUnitOfWork

尝试解决

  1. 查看官方文档发现可以在配置 EventBus 的时候提供 UseUow 注入 IUnitOfWork 服务。

期望

  1. 配置仓储或者 DbContext 中提供 UseUow 注入 API,类似与提供一个 AddRepository 的接口自动扫描注入 IxxRepo 以及实现 并注入 UseUow,仅供参考。

MASA.Framework Roadmap for 0.7.0

Roadmap

This issue represents a list of major investments that our team will focus on in the 0.6.0 time frame. It doesn't include all the features and bug fixes we'll be working on in the meantime
这个Issue代表我们团队将在 0.7.0 内重点关注的列表。它不包括我们将在此期间进行的所有功能和错误修复。

Note that this is an aspirational list of what we hope to get to. Many of these items will require thorough investigation and design, which can result in changes to our plans. We will end up cutting some things and making changes as we go, but will try to keep this issue up to date to reflect on our progress and learnings.
请注意,这是一个我们希望达到的愿望清单。 其中许多项目需要彻底的调查和设计,这可能会导致我们的计划发生变化。我们最终可能会消减一些东西,并做出改变,但将努力保持这个Issue是最新的,以反映我们的进步和学习。

The roadmap consists of the following features:
路线图包括以下特性

Globalization

Rules engine (规则引擎)

  • Support RulesEngine #311

Refactors

  • DaprStarter migrated to BuildingBlock
    DaprStarter迁移至BuildingBlock ,Caller增加与DaprStarter联动 #312
  • Removed Masa.Utils.Models.Config 删除Masa.Utils.Models.Config #317

Document (文档)

  • Readme 帮助文档
  • Documentation 文档

[Proposal] Minimal APIs ServiceBase Refactor

假设标准服务写法

var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();

app.MapGet("api/v1/catalog/{id}", GetAsync);
app.MapGet("api/v1/catalog/{id}/product", GetProductAsync);
app.MapPost("api/v1/catalog/{id}/product", CreateProductAsync);
app.MapPut("api/v1/catalog/{id}/product", UpdateProductAsync);
app.MapDelete("api/v1/catalog/{id}/product", DeleteProductAsync);
app.Map("api/v1/catalog/test", TestAsync);

app.Run();

public async Task<IResult> GetAsync(int id)
{
    // do something
}

public async Task<IResult> GetProductAsync(int id)
{
    // do something
}

public async Task<IResult> CreateProductAsync(int id, CreateProductDto product)
{
    // do something
}

public async Task<IResult> UpdateProductAsync(int id, UpdateProductDto product)
{
    // do something
}

public async Task<IResult> DeleteProductAsync(int id)
{
    // do something
}

public async Task<IResult> TestAsync()
{
    // do something
}

优化目标

自动解析ServiceBase,按照默认Route规则进行注册:
{Prefix}/{Version}/{DefaultTrimServiceName(ServiceName)}/{DefaultTrimMethod(method)}/{id?}
DefaultTrimServiceName

  1. TrimEnd:Service

DefaultTrimMethod:

  1. TrimStart:Get/Post/Create/Put/Update/Delete/Remove 等
  2. TrimEnd:Async

PS:如api/v1/user/GetAsync/1,将会变为 api/v1/user/1

优化过程

分离Map到独立的服务文件

program.cs

var builder = WebApplication.CreateBuilder(args);
var app = builder.Services.AddService(builder); //可能需要将builder,也有可能会去掉,要看MasaApp中保存Builder的顺序是否更早。
app.Run();

CatalogService.cs

public class CatalogService: ServiceBase
{
    public CatalogService() // 去掉将IServiceCollection传递给基类
    {
        App.MapGet("api/v1/catalog/{id}", GetAsync);
        App.MapGet("api/v1/catalog/{id}/product", GetProductAsync);
        App.MapPost("api/v1/catalog/{id}/product", CreateProductAsync);
        App.MapPut("api/v1/catalog/{id}/product", UpdateProductAsync);
        App.MapDelete("api/v1/catalog/{id}/product", DeleteProductAsync);
        App.Map("api/v1/catalog/test", TestAsync);
    }
}

扫描非当前程序集的ServiceBase

program.cs

var builder = WebApplication.CreateBuilder(args);
var app = builder.Services.AddService(builder, options => { AdditionalAssemblies = new[] {} }); 
app.Run();

修改固定前缀

program.cs,全局设置,注意:所有参数为空则表示忽略,如Version = "",则Url将是api/{controller}/...

var builder = WebApplication.CreateBuilder(args);
var app = builder.Services.AddService(builder, options => 
    {
        Prefix = "api",
        Version = "v1",
        PluralizeServiceName = false // 设置为true则自动将service name变成复数,如 UserService -> api/v1/users
    }); 
app.Run();

CatalogService.cs,单服务设置

public class CatalogService: ServiceBase
{
    public CatalogService()
    {
        // 可有可无,设置后优先级将覆盖全局配置
        RouteOptions.Prefix = "api";
        RouteOptions.Version = "v2";
        RouteOptions.PluralizeServiceName = true;
    }
}

自动注册方法

program.cs,全局设置

var builder = WebApplication.CreateBuilder(args);
var app = builder.Services.AddService(builder, options => 
    {
        // *Prefixes 将会告诉自动扫描的方法,如何通过前缀将方法注册到对应的HttpMethod下
        GetPrefixes = new string[] { "Get", "Select" } // 默认值是 Get
        PostPrefixes = new string[] { "Upsert", "Create" } // 默认值是 Add, Create
        PutPrefixes = new string[] { "TryPut", "Put" } // 默认值是 Update, Modify
        DeletePrefixes = new string[] { "TryDelete" } // 默认值是 Delete/Remove
    }); 
app.Run();

CatalogService.cs,单服务设置

public class CatalogService: ServiceBase
{
    public CatalogService()
    {
        // 留空即可
        // 1. 根据全局设置 Get, Post, Put, Delete 自动扫描方法注册
        // 2. 自动TrimEnd("Async")
        // 3. 未被识别的将通过Map的方式公开所有HttpMethod
    }
}

个别破坏规则的需要单独指定

CatalogService.cs,单服务设置

public class CatalogService: ServiceBase
{
    public CatalogService()
    {
        App.MapGet("v1-beta/demo/test", TestAsync); // 注册为HttpMethod = HttpGet,Url = "v1-beta/demo/test",直接通过App的Map系列方法将绕开所有的规则,直接注册到MinimalAPIs上
    }
}

任务列表

可以通过 [x] 选择已完成

  • 分离Map到独立的服务文件
  • 扫描非当前程序集的ServiceBase
  • 修改固定前缀
  • 自动注册方法
  • 个别破坏规则的需要单独指定

引用Masa.Contrib.StackSdks.Tsc包,依赖Newtonsoft Json报错

Description

image
项目中没有依赖Newtonsoft.Json

Reproduction Steps

No response

Expected behavior

No response

Actual behavior

No response

Known Workarounds

No response

.NET version

.NET 6.0

MASA Framework version

1.0.0-preview.26

Other information

No response

Creator and Modifier are not assigned

Description

AggregateRoot<Guid, Guid?> Audit attribute If you specify a nullable type, the value written to the database will always be Null even if you are logged in

Environment

.Net SDK Version: .NET 6.0
MASA Framework Version: 1.0.0-preview.21

Local message retry optimization

Local messages need to increase the last execution time to avoid repeated execution of messages

public async Task<IEnumerable<IntegrationEventLog>> RetrieveEventLogsFailedToPublishAsync(int retryBatchSize = 200, int maxRetryTimes = 10)
{
    var result = await _eventLogContext.EventLogs
        .Where(e => (e.State == IntegrationEventStates.PublishedFailed || e.State == IntegrationEventStates.InProgress) &&
            e.TimesSent <= maxRetryTimes)
        .OrderBy(o => o.CreationTime)
        .Take(retryBatchSize)
        .ToListAsync();

    if (result.Any())
    {
        _eventTypes ??= _serviceProvider.GetRequiredService<IIntegrationEventBus>().GetAllEventTypes()
            .Where(type => typeof(IIntegrationEvent).IsAssignableFrom(type));

        return result.OrderBy(o => o.CreationTime)
            .Select(e => e.DeserializeJsonContent(_eventTypes.First(t => t.Name == e.EventTypeShortName)));
    }

    return result;
}

MASA.Contrib Roadmap for 0.5.0

Roadmap

This issue represents a list of major investments that our team will focus on in the 0.5.0 time frame. It doesn't include all the features and bug fixes we'll be working on in the meantime
这个Issue代表我们团队将在 0.5.0 内重点关注的列表。它不包括我们将在此期间进行的所有功能和错误修复。

Note that this is an aspirational list of what we hope to get to. Many of these items will require thorough investigation and design, which can result in changes to our plans. We will end up cutting some things and making changes as we go, but will try to keep this issue up to date to reflect on our progress and learnings.
请注意,这是一个我们希望达到的愿望清单。 其中许多项目需要彻底的调查和设计,这可能会导致我们的计划发生变化。我们最终可能会消减一些东西,并做出改变,但将努力保持这个Issue是最新的,以反映我们的进步和学习。

The roadmap consists of the following features:
路线图包括以下特性

Ddd.Domain(领域)

  • Improve the experience of using AuditEntity #81
    提升AuditEntity的使用体验

Identity(身份)

  • Provide access to user identity information #81
    提供获取用户身份信息

IdGenerator (Id生成器)

  • Support IdGenerator, add SimpleGuid, SequentialGuid, Snowflake implementation #76
    支持IdGenerator,新增SimpleGuid、SequentialGuid、Snowflake 实现 #76

EntityFramework

  • Fix bugs using MySql #108, Fixed using soft delete filtering to cause deletes to fail due to nested references #144 , support optimistic concurrency #79, refactor MasaDbContextOptionsBuilder #122
    修复使用MySql错误 #108 , 修复使用软删除过滤由于嵌套引用导致删除失败 #144, 支持乐观并发 #79, 重构MasaDbContextOptionsBuilder #122

EventBus (事件总线)

  • EventBus: Modify the error message address #105、Fixed the issue that transaction middleware will be executed multiple times when some events (events that do not inherit ITranscation) are published, when there are nested publishing events in Handler #146 #153
    [x] EventBus: 修改错误提示信息地址 #105、修复部分事件(未继承ITranscation的事件)发布时,当Handler存在嵌套发布事件时,事务中间件会被多次执行的问题 #146 #153
  • IntegrationEvents.Dapr: Refactor DaprIntegrationEventBus #116 #150
    重构DaprIntegrationEventBus #116 #150
  • DomainEventBus: Fix aggregate root add realm event execution sequence error #120 #135
    DomainEventBus: 修复聚合根添加领域事件执行顺序错误 #120 #135

Identity

  • IdentityModel: Support Identity, Blazor is not supported yet #81 #103 #118
    支持Identity,暂不支持Blazor #81 #103 #118

DistributedLock (分布式锁)

Sdks

MinimalAPIs

  • Planning
    规划中 (迁移到后续版本)

Observability(可观测性)

  • Support OpenTelemetry
    支持OpenTelemetry 规划中 (迁移到后续版本)

Rule Engine(规则引擎)

  • Planning (Migrate to next version)
    规划中 (迁移到下个版本)

UserContext中Roles使用数组或字典,不使用IdentityRole

UserContext中Roles使用数组或字典,这样对于使用者集成Masa会更友好。
如果我们直接早已封装好ICurrentUser,不过我们的Roles使用的是数组 string[] Roles { get; }
目前升级0.5,为了兼容MASA,底层封装也得同步调整,必须引入Masa.BuildingBlocks.Identity.IdentityModel。
如果UserContext中Roles使用数组或字典,像这样情况改动就很小,只需在应用中设置IdentityClaimOptions即可。

希望能增加开放接口签名验签等功能

期望功能列表 :)

  • 证书生成
  • 证书管理
  • 公钥导出、导入
  • 开放接口格式化,如下例
{
    "specversion" : "1.0",
    "sysid" : "masa.open.test01",
    "source" : "https://github.com/cloudevents/spec/pull",
    "subject" : "123",
    "id" : "A234-1234-1234",
    "timestamp" : "2018-04-05T17:31:00Z",
    "datacontenttype" : "application/json",
    "data" : "{\"att01\":\"01\",\"att02\":\"02\"}",
    "sign": "xxx"
}

参考:
dotnet-crypto-utils

After disabling automatic mapping, mapped routes are incomplete

Description

public class PersonService : ServiceBase
{
    public PersonService()
    {
        RouteOptions.DisableAutoMapRoute = true;
        App.MapGet("list", GetListAsync);
    }

    private Task GetListAsync()
    {
        return Task.CompletedTask;
    }
}

public class GoodsService : CustomServiceBase
{
    public GoodsService()
    {
        RouteOptions.Prefix = "api";
        RouteOptions.Version = "v2";
    }

    public GoodsService(IServiceCollection services, string baseUri) : base(services, baseUri)
    {
        RouteOptions.DisableAutoMapRoute = true;
        App.MapGet("add", AddAsync);
        App.MapGet("update", UpdateAsync);
    }

    private Task<IResult> AddAsync()
    {
        return Task.FromResult(Results.Accepted());
    }

    private Task<IResult> UpdateAsync()
    {
        return Task.FromResult(Results.Accepted());
    }
}

Reproduction Steps

No response

Expected behavior

No response

Actual behavior

No response

Known Workarounds

No response

.NET version

.NET 6.0

MASA Framework version

1.0.0-preview.28

Other information

No response

cli 创建 masafx project 报错

Description

44a2cfcb4ad322eccedce09fe2047e9

Reproduction Steps

No response

Expected behavior

No response

Actual behavior

No response

Known Workarounds

No response

.NET version

7.0.1

MASA Framework version

Masa.Template::0.6.4000。

Other information

No response

是否考虑实现类似ABP VNext的基于HTTP的RPC调用

ABP对服务间调用进行了封装,用动态代理实现了RPC调用。
这是它的文档,动态代理
它是基于HTTP封装的,感觉用的非常爽,
远程调用和本地resolve 一个service,用法完全一致,比grpc还要方便(grpc还要想法子传递proto文件)。
而且对内对外不需要定义两套。
而且abp vnext从7.0开始正式支持dapr了(其实现在的版本已经有preview可以拿来用了),我看这个rpc调用也有dapr的实现方式了。
你们是否会考虑也整一个?

grpc我看了一下dapr的文档,好像同一个服务不支持同时开http和grpc,这个限制太坑了,
所以我在想,能不能在http的基础上搞一个rpc调用?

cache stack overflow

Description

I have a code for querying list data storage cache. When using multi-level cache, a stack exception occurs. The code is as follows:

public async Task<List<AlbumBrief>> GetAllBriefAsync()
    {
        TimeSpan? timeSpan = null;
        var key = $"{nameof(AlbumRepository)}_{nameof(GetAllBriefAsync)}";
        var albumList = await _multilevelCacheClient.GetOrSetAsync(key, async () =>
        {
            var albums = await Context.Set<Album>()
                .Select(cat => new AlbumBrief(cat.Name, cat.Slug, cat.Cover,
                    cat.Description,
                    Context.Set<BlogAlbum>().Count(d => d.AlbumId == cat.Id))).ToListAsync();
            var distinctAlbums = from album in albums
                where album.BlogCount > 0
                orderby album.BlogCount descending
                select album;
            var distinctAlbumList = distinctAlbums.ToList();
            if (distinctAlbumList.Any())
            {
                return new CacheEntry<List<AlbumBrief>>(distinctAlbumList, TimeSpan.FromDays(3))
                {
                    SlidingExpiration = TimeSpan.FromMinutes(5)
                };
            }

            timeSpan = TimeSpan.FromSeconds(5);
            return new CacheEntry<List<AlbumBrief>>(distinctAlbumList);
        }, options =>
            options.AbsoluteExpirationRelativeToNow = timeSpan);

        return albumList;
    }

A stack overflow problem is thrown and the program crashes:

Stack overflow.
Repeat 2243 times:
--------------------------------
   at System.Text.Json.Serialization.JsonConverter`1[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].WriteCore(System.Text.Json.Utf8JsonWriter, System.__Canon ByRef, System.Text.Json.JsonSerializerOptions, System.Text.Json.WriteStack ByRef)
   at System.Text.Json.Serialization.Metadata.JsonTypeInfo`1[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Serialize(System.Text.Json.Utf8JsonWriter, System.__Canon ByRef, System.Object, Boolean)
   at System.Text.Json.JsonSerializer.Serialize[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.Text.Json.Utf8JsonWriter, System.__Canon, System.Text.Json.JsonSerializerOptions)
   at System.Text.Json.JsonSerializerExtensions+DynamicObjectConverter.Write(System.Text.Json.Utf8JsonWriter, System.Object, System.Text.Json.JsonSerializerOptions)
   at System.Text.Json.Serialization.JsonConverter`1[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].TryWrite(System.Text.Json.Utf8JsonWriter, System.__Canon ByRef, System.Text.Json.JsonSerializerOptions, System.Text.Json.WriteStack ByRef)

Reproduction Steps

No response

Expected behavior

Successfully written to cache

Actual behavior

No response

Known Workarounds

No response

.NET version

.NET 8 Preview 3

MASA Framework version

1.0.0-preview.28

Other information

my code repository: https://github.com/dotnet9/Dotnet9/blob/Dotnet-React/src/Dotnet9.WebAPI/src/Services/Dotnet9.Service/Infrastructure/Repositories/AlbumRepository.cs

MASA.Framework Roadmap for 0.6.0

Roadmap

This issue represents a list of major investments that our team will focus on in the 0.6.0 time frame. It doesn't include all the features and bug fixes we'll be working on in the meantime
这个Issue代表我们团队将在 0.6.0 内重点关注的列表。它不包括我们将在此期间进行的所有功能和错误修复。

Note that this is an aspirational list of what we hope to get to. Many of these items will require thorough investigation and design, which can result in changes to our plans. We will end up cutting some things and making changes as we go, but will try to keep this issue up to date to reflect on our progress and learnings.
请注意,这是一个我们希望达到的愿望清单。 其中许多项目需要彻底的调查和设计,这可能会导致我们的计划发生变化。我们最终可能会消减一些东西,并做出改变,但将努力保持这个Issue是最新的,以反映我们的进步和学习。

The roadmap consists of the following features:
路线图包括以下特性

Cache(缓存)

Configuration

  • Dcc: Fix the CallerProvider obtained by ConfigurationManager does not correspond #215
    Dcc: 修复ConfigurationManager获取到的CallerProvider不对应 #215
  • Dcc: Simplified Dcc configuration #215
    Dcc: 简化Dcc配置 #215

Identity

  • Support Blazor Server #230
    支持Blazor Server #230
  • Support Blazor WebAssembly #230
    支持Blazor WebAssembly #230
  • Support for custom user models #192
    支持自定义用户模型 #192

Caller (调用者)

MinimalAPIS

  • Supports automatic mapping of routes And a group of services to set a permission policy once #238 #243 #253
    支持自动映射路由和一组服务设置一次权限策略 #238 #243 #253

Cqrs (读写分离)

  • Query removes the restriction that Result is not empty #171 #184
    Query移除Result不为空限制 #171 #184

Data (数据)

  • Support serialization and deserialization (支持序列化、反序列化) #192 #203
  • Support type conversion (支持类型转换) #192 #203
  • Refactor IdGenerator, support IdGeneratorFactory (重构IdGenerator、支持IdGeneratorFactory) #188
  • Mapster supports nested type mappings (Mapster支持嵌套类型映射) #249
  • Fix soft delete bug (修复软删除Bug) #250

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.