From b5b2b758c9289cd7286839745ab3dab5e15ae666 Mon Sep 17 00:00:00 2001 From: CodeLiturgy Date: Mon, 29 Aug 2022 17:30:24 +0100 Subject: [PATCH] update template using nameof to specify id --- BlueWest.Api/Context/CompanyDbContext.cs | 4 ++-- BlueWest.Api/Context/CountryDbContext.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/BlueWest.Api/Context/CompanyDbContext.cs b/BlueWest.Api/Context/CompanyDbContext.cs index c40f13a..d608411 100644 --- a/BlueWest.Api/Context/CompanyDbContext.cs +++ b/BlueWest.Api/Context/CompanyDbContext.cs @@ -18,7 +18,7 @@ namespace BlueWest.WebApi.EF [EfUpdateMethods( updateType: typeof(CompanyUpdate), returnType: typeof(CompanyUnique), - keyPropertyMemberName: "Id", + keyPropertyMemberName: nameof(Company.Id), keyPropertyMemberType: typeof(int)) ] @@ -36,7 +36,7 @@ namespace BlueWest.WebApi.EF [EfUpdateMethods( updateType: typeof(IndustryUpdate), returnType: typeof(IndustryUnique), - keyPropertyMemberName: "Id", + keyPropertyMemberName: nameof(Industry.Id), keyPropertyMemberType: typeof(int)) ] diff --git a/BlueWest.Api/Context/CountryDbContext.cs b/BlueWest.Api/Context/CountryDbContext.cs index 37bf0be..cff8a29 100644 --- a/BlueWest.Api/Context/CountryDbContext.cs +++ b/BlueWest.Api/Context/CountryDbContext.cs @@ -24,7 +24,7 @@ namespace BlueWest.WebApi.EF [EfUpdateMethods( updateType: typeof(CountryUpdate), returnType: typeof(CountryUnique), - keyPropertyMemberName: "Id", + keyPropertyMemberName: nameof(Country.Id), keyPropertyMemberType: typeof(int)) ] public DbSet Countries { get; set; } @@ -38,7 +38,7 @@ namespace BlueWest.WebApi.EF [EfUpdateMethods( updateType: typeof(CurrencyUpdate), returnType: typeof(CurrencyUnique), - keyPropertyMemberName: "Id", + keyPropertyMemberName: nameof(Currency.Id), keyPropertyMemberType: typeof(int)) ] public DbSet Currencies { get; set; }