2022-08-27 23:02:46 +03:00
|
|
|
|
2022-08-28 21:39:40 +03:00
|
|
|
public static (bool, {returnTypeFullName}) Add{entityTypeName}(
|
2022-08-28 20:00:09 +03:00
|
|
|
this {contextFullName} dbContext, {createTypeFullName} {toCreateVarName}) {
|
|
|
|
var {newEntityVarName} = new {entityTypeFullName}({toCreateVarName});
|
|
|
|
dbContext.{propertyName}.Add({newEntityVarName});
|
|
|
|
var success = dbContext.SaveChanges() >= 0;
|
2022-08-28 21:39:40 +03:00
|
|
|
return (success, new {returnTypeFullName}({newEntityVarName}));
|
2022-08-28 20:00:09 +03:00
|
|
|
}
|