From 13627dbcb6579287ebc14bdb4bae0bb2589edfa9 Mon Sep 17 00:00:00 2001 From: CodeLiturgy Date: Sun, 28 Aug 2022 18:00:09 +0100 Subject: [PATCH] ok --- BlueWest.Api/BlueWest.Api.csproj | 3 +-- BlueWest.Api/Context/AttributeNavigation.cs | 10 ---------- .../Context/Templates/AddToEntityTemplate.csx | 16 +++++++--------- include/BlueWest.MapTo | 2 +- 4 files changed, 9 insertions(+), 22 deletions(-) delete mode 100644 BlueWest.Api/Context/AttributeNavigation.cs diff --git a/BlueWest.Api/BlueWest.Api.csproj b/BlueWest.Api/BlueWest.Api.csproj index c63356d..6018318 100644 --- a/BlueWest.Api/BlueWest.Api.csproj +++ b/BlueWest.Api/BlueWest.Api.csproj @@ -18,8 +18,7 @@ - - + diff --git a/BlueWest.Api/Context/AttributeNavigation.cs b/BlueWest.Api/Context/AttributeNavigation.cs deleted file mode 100644 index b00cbc4..0000000 --- a/BlueWest.Api/Context/AttributeNavigation.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace BlueWest.WebApi.Context; - -public class AttributeNavigation -{ - object HasForeignKey( - Expression> foreignKeyExpression) - { - - } -} \ No newline at end of file diff --git a/BlueWest.Api/Context/Templates/AddToEntityTemplate.csx b/BlueWest.Api/Context/Templates/AddToEntityTemplate.csx index 1c12f32..cc863fd 100644 --- a/BlueWest.Api/Context/Templates/AddToEntityTemplate.csx +++ b/BlueWest.Api/Context/Templates/AddToEntityTemplate.csx @@ -1,10 +1,8 @@ -public static partial class {entityTypeName}Extensions { - public static (bool, {readTypeFullName}) Add{entityTypeName}( - this {contextFullName} dbContext, {createTypeFullName} {toCreateVarName}) { - var {newEntityVarName} = new {entityTypeFullName}({toCreateVarName}); - dbContext.{propertyName}.Add({newEntityVarName}); - var success = dbContext.SaveChanges() >= 0; - return (success, new {readTypeFullName}({newEntityVarName})); - } -} +public static (bool, {readTypeFullName}) Add{entityTypeName}( +this {contextFullName} dbContext, {createTypeFullName} {toCreateVarName}) { + var {newEntityVarName} = new {entityTypeFullName}({toCreateVarName}); + dbContext.{propertyName}.Add({newEntityVarName}); + var success = dbContext.SaveChanges() >= 0; + return (success, new {readTypeFullName}({newEntityVarName})); +} diff --git a/include/BlueWest.MapTo b/include/BlueWest.MapTo index 4d9cc4b..12d5839 160000 --- a/include/BlueWest.MapTo +++ b/include/BlueWest.MapTo @@ -1 +1 @@ -Subproject commit 4d9cc4b029b15049b5d9a8bb8e87f6d9a513b712 +Subproject commit 12d5839f1660c0cf89be22d391b1f744a37c202e