fix(dal,aihitMainSyncer): FieldValues поле Value теперь уникально. В aihitMainSyncer поднят уровень журналированияя
This commit is contained in:
3487
PARR.DAL/Migrations/20250521063857_tblFieldValuesValueIsUniqueClmn.Designer.cs
generated
Normal file
3487
PARR.DAL/Migrations/20250521063857_tblFieldValuesValueIsUniqueClmn.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,41 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PARR.DAL.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class tblFieldValuesValueIsUniqueClmn : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_FieldValues_Value",
|
||||
schema: "unit",
|
||||
table: "FieldValues");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_FieldValues_Value",
|
||||
schema: "unit",
|
||||
table: "FieldValues",
|
||||
column: "Value",
|
||||
unique: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_FieldValues_Value",
|
||||
schema: "unit",
|
||||
table: "FieldValues");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_FieldValues_Value",
|
||||
schema: "unit",
|
||||
table: "FieldValues",
|
||||
column: "Value");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2621,7 +2621,8 @@ namespace PARR.DAL.Migrations
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Value");
|
||||
b.HasIndex("Value")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("FieldValues", "unit", t =>
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace PARR.DAL.Models.Unit
|
||||
{
|
||||
[Table("FieldValues", Schema = DataContextSettings.Unit)]
|
||||
[Comment("Значения полей ЭК")]
|
||||
[Index(nameof(Value))]
|
||||
[Index(nameof(Value), IsUnique = true)]
|
||||
public class UnitFieldValue : IBase
|
||||
{
|
||||
[Key]
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace PARR.DAL.Services.Implementations.Unit
|
||||
|
||||
public async Task<UnitField?> GetByAihitNameAsync(string name)
|
||||
{
|
||||
return await EntitySet.FirstOrDefaultAsync(uf => uf.AihitName.ToLower() == name.ToLower());
|
||||
return await EntitySet.FirstOrDefaultAsync(uf => uf.AihitName.ToLower().Trim() == name.ToLower().Trim());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user