예제 #1
0
        /// <summary>
        /// Generate the method for the current ObjectType.
        /// </summary>
        /// <returns>Builded method</returns>
        protected override IResponse InternalMake()
        {
            Type            normalizedType = ctx.ObjectType;
            ArgumentElement instance       = new ArgumentElement(0, ctx.ObjectType);

            if (ctx.IsDeserializing)
            {
                normalizedType = normalizedType.GetElementType();
                CreateAndAssignNewInstance(instance, null);
            }

            var versions = VersionHelper.GetExplicitlyManagedVersions(normalizedType).ToArray();

            if (versions.Length > 1)
            {
                ManageVersions(instance, versions, normalizedType);
            }
            else
            {
                BuildFromFields(VersionHelper.GetAllFields(instance, normalizedType));
                ctx.G.Return();
            }

            return(ctx.Provider.GetMethod());
        }
예제 #2
0
 public bool Equals(ArgumentElement other)
 {
     if (ReferenceEquals(null, other))
         return false;
     if (ReferenceEquals(this, other))
         return true;
     return Equals(other.Id, Id);
 }
예제 #3
0
 public bool Equals(ArgumentElement other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(Equals(other.Id, Id));
 }