The future of .NET has come, are you coming? !

re-start

Don’t forget the original intention, thank you for meeting, thank you for trust

September 1, 2020, a call Fur of open source projects in Gitee She was born quietly in her swaddling cot, her birth seemed to carry some kind of mission, no burden, infinite possibilities.

She opened her eyes slowly, and her clean and bright eyes seemed to be full of curiosity about this world. Anything that flashed in front of her eyes was like a collision of thoughts directly hitting her soul. These were very precious treasures in her eyes. She seems to have inexhaustible energy, gaining knowledge along the way, leveling up to fight monsters, running constantly, and never tired of it.

I remember the Singles Day on November 11, 2020. She ushered in her “one-year-old (v1.0.0)” birthday. Since then, she has frequently appeared on the big screen of IT, and more and more .NET5 The developer turned fans, like telling the world that she is a big star in the IT industry.

Every star has a good stage name, and she is of course no exception. On November 20, 2020, the agent Bai Xiaoseng named her Furion.

Since November 09, 2021, she has entered a period of rebelliousness that every child has experienced. .NET5 Fans, throw in the new .NET6 In the arms of the fans, he has lived a luxurious and prosperous life since then.

But she was unhappy, often thinking of it at night .NET5 ‘s fans are very self-blame, but under the pressure of double work, she resolutely chose to ignore their demands, as if they were a burden.

Time is really a good thing, and I once thought it was right. After years of wasting and grinding, I gradually realized that if you don’t forget your original intention, you can stay forever.

This time, no one is left behind (.NET5,.NET6…,.NET N), go hand in hand, set sail again, be grateful for the encounter, and be grateful for the trust.


Project information


Preparation

When the Preview version of .NET7 was released, the Furion team really adapted it. It took more than 4 months to solve all the problems of upgrading from .NET5 to .NET6 and .NET7.A set of code is guaranteed to be compatible with .NET5+, and supports all existing Furion version upgrades, including 0.x, 1.x, 2.x, 3.x versions.

In the process of adapting to .NET7, we mainly refer to two documents provided by Microsoft:


Documentation update

1. Built-in powerful real-time local search

2. Add documentation for upgrading or integrating .NET7

3. Improve changelog template specification


Update in this issue

  • new features

    • [新增] Added friendly exception to control whether to output error log configuration LogError: true #I5PKJH
    • [新增] DateOnlyJsonConverter and DateOnlyOffsetJsonConverter serializer !565
    • [新增] event bus LogEnabled Configuration to control whether to output service logs #I5QLY5
    • [新增] Can implement any set of normalized result functions, support specific controllers, specific methods #I5QZ37
  • Breakthrough change

    • [支持] .NET 6.0.9 and .NET 7.0 RC1 be5b40 1eee77b
    • [调整] remote request .SetBodyBytes for .SetFiles #I5PMS5 #I5PIYI
    • [移除] remote request [BodyBytes] design, using HttpFile Way #I5PMS5 #I5PIYI
    • [调整] all AddInject and UseInject Parametric design #I5QCF0
    • [调整] remote request all xxxAsStreamAsync return value #I5QVEB
  • bug fix

    • [修复] Array overflow problem caused by non-generic parameters in remote request proxy mode #I5Q3SN
    • [修复] LoggingMonitor client IP log error #I5QCU1 !562
    • [修复] The remote request response message contains charset=gbk The problem of garbled characters after serialization #I5QVEB
    • [修复] Lost log problem when file log is powered off db7d51b
  • other changes

    • [调整] JWTEncryption Static class, support without registration services.AddJwt() use #I5PPKE #I5POLZ
    • [调整] The default log class name of the event bus is System.Logging.EventBusService #I5QLY5
  • Documentation

    • [新增] .NET6 upgrade .NET7 Documentation
    • [新增] ASP.NET 7 Integrated Documentation
    • [更新] Friendly exception documentation, remote request documentation, dependency injection documentation, instant messaging documentation, event bus documentation, worker service documentation, unit testing documentation, getting started documentation

Highlights of this issue

1. The document supports full-text search, fuzzy search, code search, and search highlighting

2. Remotely requesting third-party APIs to upload files is easier to use

proxy mode


public interface IHttp : IHttpDispatchProxy
{
    [Post("https://www.furion.icu/upload", ContentType = "multipart/form-data")] 
    Task<HttpResponseMessage> PostXXXAsync(HttpFile file);

    // 支持多个文件
    [Post("https://www.furion.icu/upload", ContentType = "multipart/form-data")] 
    Task<HttpResponseMessage> PostXXXAsync(HttpFile[] files);
    
    // 支持多个文件
    [Post("https://www.furion.icu/upload", ContentType = "multipart/form-data")] 
    Task<HttpResponseMessage> PostXXXAsync(IList<HttpFile> files);
}

string pattern


var bytes = File.ReadAllBytes("image.png");

// 单个文件
var result = await "https://localhost:44316/api/test-module/upload-file"
                      .SetContentType("multipart/form-data")
                      .SetFiles(HttpFile.Create("file", bytes, "image.png")).PostAsync();

// 多个文件
var result = await "https://localhost:44316/api/test-module/upload-muliti-file"
                      .SetContentType("multipart/form-data")
                      .SetFiles(HttpFile.CreateMultiple("files", (bytes, "image1.png"), (bytes, "image2.png"))).PostAsync();

3. Simplified framework initial configuration parameter signature


public void ConfigureServices(IServiceCollection services)
{
    services.AddInject(options =>
    {
        options.ConfigureSwaggerGen(gen => 
        {
            // ...
        });
    });
}

 public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
 {
      app.UseInject(configure: options =>
      {
          options.ConfigureSwagger(swg => 
          {
              // ...
          });

          options.ConfigureSwaggerUI(ui =>
          {
             // ...
          });
      });
}

4. Support multi-set interface normalization processing


// 替换默认的
services.AddUnifyProvider<SpeciallyResultProvider>();

// 添加更多规范化配置
services.AddUnifyProvider<SpeciallyResultProvider>("unique_name");

[UnifyProvider]    // 默认的(不贴也是默认的)
public class FurionAppService: IDynamicApiController
{
}

[UnifyProvider("specially")]    // 自定义的
public class FurionAppService: IDynamicApiController
{
}


[UnifyProvider]    // 默认的
public class FurionAppService: IDynamicApiController
{
    [UnifyProvider("specially")] // 复写默认的
    public string GetName()
    {
    }
}

#Adapt #NET #RC1 #future #Furion #v444 #released #News Fast Delivery

Leave a Comment

Your email address will not be published. Required fields are marked *