Skip to content

Releases: vipwan/Biwen.AutoClassGen

1.3.3 released

19 Jun 19:28
Compare
Choose a tag to compare

提供NET8+ keyed Service支持

//NET8.0+ 支持keyed
[AutoInjectKeyed<ITest2Service>("test2", ServiceLifetime.Transient)]
[AutoInjectKeyed<ITest2Service>(nameof(TestService2))]
public class TestService2 : ITest2Service
{
    public string Say2(string message)
    {
        return message;
    }
}

将会生成:

public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddAutoInject(this Microsoft.Extensions.DependencyInjection.IServiceCollection services)
{
    services.AddKeyedTransient<Biwen.AutoClassGen.TestConsole.Services.ITest2Service, Biwen.AutoClassGen.TestConsole.Services.TestService2>("test2");
    services.AddKeyedScoped<Biwen.AutoClassGen.TestConsole.Services.ITest2Service, Biwen.AutoClassGen.TestConsole.Services.TestService2>("TestService2");
    return services;
}

1.3.2.3 released

27 Mar 07:03
Compare
Choose a tag to compare

提供非泛型的特性标注

[AutoInject]
[AutoInject(serviceLifetime: ServiceLifetime.Transient)]
[AutoInject(typeof(ITest2Service), ServiceLifetime.Scoped)]
public class TestService2 : ITest2Service
{
    public string Say2(string message)
    {
        return message;
    }
}

1.3.0 released

26 Mar 14:57
Compare
Choose a tag to compare

1.2.1.3 released

22 Jan 06:49
Compare
Choose a tag to compare
  • 修复DTO生成器当 escapeCols为空报错的问题
  • 修复MapperToDto赋值的accessibility报错的问题

1.2.1

11 Nov 20:43
Compare
Choose a tag to compare
  1. 支持C#11 泛型标注DTO生成 [AutoDto<T>(params string[] excludeProps)]
  2. 支持装配器模型自动生成 [AutoDecor(Type type)] or [AutoDecor<T>] 更多帮助: #5

1.1.0.3

07 Nov 15:05
Compare
Choose a tag to compare

AutoClassGen生成代码合并成单个文件 #4

1.1.0.2

05 Nov 18:20
Compare
Choose a tag to compare
  1. DTO生成器合并到单个文件中
  2. 修复分析器中的错误
  3. 支持一个Entity转换为多个DTO

1.1.0

05 Nov 05:41
Compare
Choose a tag to compare

提供对DTO生成的支持:

    class BaseEntity
    {
        int Id { get; set; }
    }
    class UserInfo : BaseEntity
    {
        public string? Name { get; set; }
        public int Age { get; set; }

        public string? Remark { get; set; }

        public string? Address { get; set; }

        public string? Phone { get; set; }

        public string? EscapedCol { get; set; }
    }
    [AutoDto(typeof(UserInfo), nameof(UserInfo.Remark), "EscapedCol")]
    partial class UserInfoDto { }

生成的DTO :

using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using Biwen.QuickApi.DemoWeb.Apis;

#pragma warning disable
namespace Biwen.QuickApi.DemoWeb.Apis
{
    public partial class UserInfoDto
    {
        /// <inheritdoc cref = "BaseEntity.Id"/>
        public int Id { get; set; }
        /// <inheritdoc cref = "UserInfo.Name"/>
        public string? Name { get; set; }
        /// <inheritdoc cref = "UserInfo.Age"/>
        public int Age { get; set; }
        /// <inheritdoc cref = "UserInfo.Address"/>
        public string? Address { get; set; }
        /// <inheritdoc cref = "UserInfo.Phone"/>
        public string? Phone { get; set; }
    }
}
#pragma warning restore

1.0.0.6

04 Nov 08:32
Compare
Choose a tag to compare

GEN031: Suggestions to use [AutoGen] attribute to mark the interface #1

1.0.0.4

03 Nov 09:32
Compare
Choose a tag to compare

more analysis