Explorar o código

Update decorators.ts

aWeirdo %!s(int64=5) %!d(string=hai) anos
pai
achega
7fcd7dfe16
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      src/Misc/decorators.ts

+ 2 - 2
src/Misc/decorators.ts

@@ -275,7 +275,7 @@ export class SerializationHelper {
             var propertyType = propertyDescriptor.type;
             var sourceProperty = (<any>entity)[property];
 
-            if (sourceProperty !== undefined && sourceProperty !== null) {
+            if (sourceProperty !== undefined && sourceProperty !== null && property !== "uniqueId") {
                 switch (propertyType) {
                     case 0:     // Value
                         serializationObject[targetPropertyName] = sourceProperty;
@@ -350,7 +350,7 @@ export class SerializationHelper {
             var sourceProperty = source[propertyDescriptor.sourceName || property];
             var propertyType = propertyDescriptor.type;
 
-            if (sourceProperty !== undefined && sourceProperty !== null) {
+            if (sourceProperty !== undefined && sourceProperty !== null && property !== "uniqueId") {
                 var dest = <any>destination;
                 switch (propertyType) {
                     case 0:     // Value