コード例 #1
0
ファイル: Converters.cs プロジェクト: Lanayx/RadrugaCloud
        /// <summary>
        ///     To the azure model.
        /// </summary>
        /// <param name="commonPlace">The common place.</param>
        /// <returns>CommonPlaceAzure.</returns>
        public static CommonPlaceAzure ToAzureModel(this CommonPlace commonPlace)
        {
            var azureModel = new CommonPlaceAzure(commonPlace.Name, commonPlace.IsApproved)
            {
                SettlementId = commonPlace.SettlementId,
                Coordinate   = commonPlace.Coordinate.ConvertToAzureCoordinate()
            };

            return(azureModel);
        }
コード例 #2
0
ファイル: Converters.cs プロジェクト: Lanayx/RadrugaCloud
        /// <summary>
        ///     Froms the azure model.
        /// </summary>
        /// <param name="azureModel">The azure model.</param>
        /// <returns>CommonPlace.</returns>
        public static CommonPlace FromAzureModel(this CommonPlaceAzure azureModel)
        {
            if (azureModel == null)
            {
                return(null);
            }

            var domainModel = new CommonPlace();

            azureModel.CopyTo(domainModel);
            domainModel.Coordinate = azureModel.Coordinate.ConvertToGeoCoordinate();
            domainModel.IsApproved = azureModel.IsApprovedCoordinate;

            return(domainModel);
        }