This commit is contained in:
parent
6540959778
commit
13627dbcb6
|
@ -18,8 +18,7 @@
|
|||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AdditionalFiles Include=".\Extensions\AddToEntityTemplate.csx" />
|
||||
<AdditionalFiles Include="Context\Templates\AddToEntityTemplate.csx" />
|
||||
<AdditionalFiles Include=".\Context\Templates\AddToEntityTemplate.csx" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
namespace BlueWest.WebApi.Context;
|
||||
|
||||
public class AttributeNavigation<T>
|
||||
{
|
||||
object HasForeignKey<TDependentEntity>(
|
||||
Expression<Func<TDependentEntity, object?>> foreignKeyExpression)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
|
@ -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}));
|
||||
}
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 4d9cc4b029b15049b5d9a8bb8e87f6d9a513b712
|
||||
Subproject commit 12d5839f1660c0cf89be22d391b1f744a37c202e
|
Loading…
Reference in New Issue