Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Weaver/Xtensive.Orm.Weaver/ReferenceRegistry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ public sealed class ReferenceRegistry
public TypeReference Type { get; set; }
public TypeReference Exception { get; set; }
public TypeReference RuntimeTypeHandle { get; set; }
public TypeReference StreamingContext { get; set; }
public TypeReference SerializationInfo { get; set; }

public MethodReference TypeGetTypeFromHandle { get; set; }
public MethodReference CompilerGeneratedAttributeConstructor { get; set; }
Expand Down
2 changes: 0 additions & 2 deletions Weaver/Xtensive.Orm.Weaver/Stages/ImportReferencesStage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ public override ActionResult Execute(ProcessorContext context)
var typeType = registry.Type = ImportType(context, mscorlibAssembly, "System.Type");
var exceptionType = registry.Exception = ImportType(context, mscorlibAssembly, "System.Exception");
var runtimeTypeHandleType = registry.RuntimeTypeHandle = ImportType(context, mscorlibAssembly, "System.RuntimeTypeHandle", true);
registry.SerializationInfo = ImportType(context, mscorlibAssembly, "System.Runtime.Serialization.SerializationInfo");
registry.StreamingContext = ImportType(context, mscorlibAssembly, "System.Runtime.Serialization.StreamingContext", true);
registry.TypeGetTypeFromHandle = ImportMethod(context, typeType, "GetTypeFromHandle", false, typeType, runtimeTypeHandleType);
registry.CompilerGeneratedAttributeConstructor = ImportConstructor(context, mscorlibAssembly, WellKnown.CompilerGeneratedAttribute);

Expand Down
54 changes: 26 additions & 28 deletions Weaver/Xtensive.Orm.Weaver/Stages/ModifyPersistentTypesStage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,41 +22,39 @@ public override ActionResult Execute(ProcessorContext context)
{
var references = context.References;

entityFactorySignatures = new[] {
new[] {references.SerializationInfo, references.StreamingContext},
new[] {references.Session, references.EntityState},
};

structureFactorySignatures = new[] {
new[] {references.SerializationInfo, references.StreamingContext},
new[] {references.Session, references.Tuple},
new[] {references.Persistent, references.FieldInfo},
};

entitySetFactorySignatures = new[] {
new[] {references.SerializationInfo, references.StreamingContext},
new[] {references.Entity, references.FieldInfo},
};
entityFactorySignatures = [
[references.Session, references.EntityState],
];

structureFactorySignatures = [
[references.Session, references.Tuple],
[references.Persistent, references.FieldInfo],
];

entitySetFactorySignatures = [
[references.Entity, references.FieldInfo],
];

propertyChecker = (context.Language==SourceLanguage.CSharp)
? (IPersistentPropertyChecker) new CsPropertyChecker()
: new VbPropertyChecker();

foreach (var type in context.PersistentTypes)
foreach (var type in context.PersistentTypes) {
switch (type.Kind) {
case PersistentTypeKind.Entity:
ProcessEntity(context, type);
break;
case PersistentTypeKind.EntitySet:
ProcessEntitySet(context, type);
break;
case PersistentTypeKind.EntityInterface:
ProcessEntityInterface(context, type);
break;
case PersistentTypeKind.Structure:
ProcessStructure(context, type);
break;
case PersistentTypeKind.Entity:
ProcessEntity(context, type);
break;
case PersistentTypeKind.EntitySet:
ProcessEntitySet(context, type);
break;
case PersistentTypeKind.EntityInterface:
ProcessEntityInterface(context, type);
break;
case PersistentTypeKind.Structure:
ProcessStructure(context, type);
break;
}
}

if (propertyChecker.HasSkippedProperties) {
context.Logger.Write(MessageCode.ErrorPersistentPropertiesWereNotProcessed);
Expand Down
Loading