2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2025-06-27 05:23:13 +00:00

inheritance

This commit is contained in:
2022-06-20 20:51:04 +03:00
parent 26709a959c
commit 0dc457bf7e
5 changed files with 31 additions and 23 deletions

View File

@ -6,7 +6,7 @@
<Copyright>Ahmed Kh. Zamil</Copyright>
<PackageProjectUrl>http://www.esiur.com</PackageProjectUrl>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>2.2.4.4</Version>
<Version>2.2.5</Version>
<RepositoryUrl>https://github.com/esiur/esiur-dotnet</RepositoryUrl>
<Authors>Ahmed Kh. Zamil</Authors>
<AssemblyVersion></AssemblyVersion>

View File

@ -219,16 +219,6 @@ public class TypeTemplate
// Add self
list.Add(template);
// Add parents
var parentType = template.ParentDefinedType;
// Get parents
while (parentType != null)
{
var parentTemplate = Warehouse.GetTemplateByType(parentType);
list.Add(parentTemplate);
parentType = parentTemplate.ParentDefinedType;
}
Action<TypeTemplate, List<TypeTemplate>> getDependenciesFunc = null;
@ -237,6 +227,20 @@ public class TypeTemplate
if (template.DefinedType == null)
return;
// Add parents
var parentType = tmp.ParentDefinedType;
// Get parents
while (parentType != null)
{
var parentTemplate = Warehouse.GetTemplateByType(parentType);
if (parentTemplate != null)
{
list.Add(parentTemplate);
parentType = parentTemplate.ParentDefinedType;
}
}
// functions
foreach (var f in tmp.functions)
{
@ -803,7 +807,7 @@ public class TypeTemplate
if (hasParent)
{
// find the first parent type that implements IResource
var ParentDefinedType = ResourceProxy.GetBaseType(type.BaseType);
ParentDefinedType = ResourceProxy.GetBaseType(type.BaseType);
var parentId = GetTypeGuid(ParentDefinedType);
b.AddGuid(parentId);
}
@ -838,7 +842,8 @@ public class TypeTemplate
var parent = type.BaseType;
if (parent == typeof(Resource)
|| parent == typeof(Record))
|| parent == typeof(Record)
|| parent == typeof(EntryPoint))
return false;
while (parent != null)

View File

@ -1,2 +1,4 @@
1- Change branch to main
2- Generic Records/Resources
2- Generic Records/Resources
3- Static functions calls
4- Scan assembly for child classes