Releases: vipwan/Biwen.AutoClassGen
Releases · vipwan/Biwen.AutoClassGen
1.3.3 released
提供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
提供非泛型的特性标注
[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
#7 提供 AutoInject 支持
Doc https://github.com/vipwan/Biwen.AutoClassGen/blob/master/Gen-AutoInject.md
1.2.1.3 released
- 修复DTO生成器当 escapeCols为空报错的问题
- 修复MapperToDto赋值的accessibility报错的问题
1.2.1
1.1.0.3
1.1.0.2
1.1.0
提供对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