Exemplo n.º 1
0
        /// <inheritdoc />
        public Location Convert(LocationDataContract value, object state)
        {
            if (value == null)
            {
                throw new ArgumentNullException("value", "Precondition: value != null");
            }

            Location location;
            IConverter <LocationDataContract, Location> converter;

            if (this.typeConverters.TryGetValue(value.Type, out converter))
            {
                location = converter.Convert(value, state);
            }
            else
            {
                location = new UnknownLocation();
            }

            var center = value.Center;

            if (center != null && center.Length == 3)
            {
                location.Center = this.converterForVector3D.Convert(center, state);
            }

            return(location);
        }
Exemplo n.º 2
0
        /// <inheritdoc />
        public Location Convert(LocationDTO value, object state)
        {
            var entity = new UnknownLocation();

            this.Merge(entity, value, state);
            return(entity);
        }
Exemplo n.º 3
0
 // Implement this method in a buddy class to set properties that are specific to 'UnknownLocation' (if any)
 partial void Merge(UnknownLocation entity, LocationDTO dto, object state);