Skip to content

Commit

Permalink
add required 特性
Browse files Browse the repository at this point in the history
  • Loading branch information
luoyunchong committed Aug 6, 2023
1 parent caab64d commit c9282f5
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 14 deletions.
4 changes: 2 additions & 2 deletions samples/IGeekFan.FreeKit.Web/IGeekFan.FreeKit.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
<PackageReference Include="FreeSql.Provider.SqlServer" Version="$(DefaultFreeSqlVersion)" />
<PackageReference Include="FreeSql.Provider.PostgreSQL" Version="$(DefaultFreeSqlVersion)" />
<PackageReference Include="FreeSql.Provider.Oracle" Version="$(DefaultFreeSqlVersion)" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.8" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="$(DefaultAspNetCoreVersion7)" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="7.0.8" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="$(DefaultAspNetCoreVersion7)" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion samples/Sample.Localization/Sample.Localization.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<ItemGroup>
<PackageReference Include="FreeSql.DbContext" Version="$(DefaultFreeSqlVersion)" />
<PackageReference Include="FreeSql.Provider.Sqlite" Version="$(DefaultFreeSqlVersion)" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="7.0.8" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="$(DefaultAspNetCoreVersion7)" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)' ">
<PackageReference Include="Microsoft.Extensions.Identity.Stores" Version="7.0.8" />
<PackageReference Include="Microsoft.Extensions.Identity.Stores" Version="$(DefaultAspNetCoreVersion7)" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == '$(DefaultNetCoreTargetFramework7)' ">
<PackageReference Include="Microsoft.Extensions.Identity.Stores" Version="7.0.8" />
<PackageReference Include="Microsoft.Extensions.Identity.Stores" Version="$(DefaultAspNetCoreVersion7)" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/IGeekFan.AspNetCore.Identity.FreeSql/UserStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ public override ISelect<TUser> Users
/// <summary>
/// Return a role with the normalized name if it exists.
/// </summary>
/// <param name="normalizedRoleName">The normalized role name.</param>
/// <param name="normalizedRoleName">The normalized role name.</param>_roles.
/// <param name="cancellationToken">The <see cref="CancellationToken"/> used to propagate notifications that the operation should be canceled.</param>
/// <returns>The role if it exists.</returns>
protected override Task<TRole> FindRoleAsync(string normalizedRoleName, CancellationToken cancellationToken)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FreeSql.DbContext" Version="$(DefaultFreeSqlVersion)" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="7.0.8" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="$(DefaultAspNetCoreVersion7)" />
</ItemGroup>

<ItemGroup>
Expand Down
9 changes: 7 additions & 2 deletions src/IGeekFan.FreeKit.Email/MailKitOptions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace IGeekFan.FreeKit.Email;
using System.ComponentModel.DataAnnotations;

namespace IGeekFan.FreeKit.Email;

/// <summary>
/// 邮件配置项
Expand All @@ -9,6 +11,7 @@ public class MailKitOptions
/// SMTP主机服务器地址
/// SMTP Host Server address
/// </summary>
[Required]
public string Host { get; set; }

/// <summary>
Expand All @@ -33,18 +36,20 @@ public class MailKitOptions
/// 发件人邮件
/// send user name
/// </summary>
[Required]
public string UserName { get; set; }

/// <summary>
/// 发件人授权密码
/// send user password
/// </summary>
[Required]
public string Password { get; set; }


/// <summary>
/// 要登录SMTP服务器的域名
/// Domain name to login to SMTP server.
/// </summary>
public string Domain { get; set; }
public string? Domain { get; set; }
}
1 change: 1 addition & 0 deletions src/IGeekFan.FreeKit.Extras/AuditEntity/Entity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public abstract class Entity<T> : IEntity<T> where T : IEquatable<T>
/// 主键Id
/// </summary>
[Column(IsPrimary = true, IsIdentity = true, Position = 1)]
[Required]
public virtual T Id { get; set; }

public virtual object[] GetKeys()
Expand Down
3 changes: 2 additions & 1 deletion src/IGeekFan.FreeKit/Extras/AuditEntity/IEntityDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public interface IEntityDto<TKey> : IEntityDto where TKey : IEquatable<TKey>
/// <summary>
/// 主键Id
/// </summary>
[Required]
TKey Id { get; set; }
}

Expand All @@ -25,4 +26,4 @@ public abstract class EntityDto<TKey> : IEntityDto<TKey> where TKey : IEquatable

public abstract class EntityDto : EntityDto<Guid>
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@

<ItemGroup>
<PackageReference Include="FreeSql" Version="$(DefaultFreeSqlVersion)" />
<PackageReference Include="Microsoft.Extensions.Localization" Version="7.0.8" />
<PackageReference Include="Microsoft.Extensions.Localization" Version="$(DefaultAspNetCoreVersion7)" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<ItemGroup>
<PackageReference Include="FreeSql.Provider.SqliteCore" Version="$(DefaultFreeSqlVersion)" />
<PackageReference Include="Microsoft.AspNetCore.Identity.Specification.Tests" Version="5.0.17" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="7.0.8" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="$(DefaultAspNetCoreVersion7)" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
<PackageReference Include="Moq" Version="4.18.4" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<ItemGroup>
<PackageReference Include="FreeSql.Provider.Sqlite" Version="$(DefaultFreeSqlVersion)" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="7.0.8" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="$(DefaultAspNetCoreVersion7)" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
<PackageReference Include="xunit" Version="2.4.2" />
Expand Down
2 changes: 1 addition & 1 deletion test/IGeekFan.FreeKit.xUnit/IGeekFan.FreeKit.xUnit.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<ItemGroup>
<PackageReference Include="FreeSql.Provider.Sqlite" Version="$(DefaultFreeSqlVersion)" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="7.0.8" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="$(DefaultAspNetCoreVersion7)" />
<PackageReference Include="Xunit.DependencyInjection" Version="8.7.1" />
<PackageReference Include="Microsoft.DependencyValidation.Analyzers" Version="0.11.0" />
<PackageReference Include="Serilog.Extensions.Hosting" Version="7.0.0" />
Expand Down

0 comments on commit c9282f5

Please sign in to comment.