public static PlaceOfInterestCategory Create(DrumbleApp.Shared.Data.Models.PlaceOfInterestCategory placeOfInterestCategory) { if (placeOfInterestCategory == null) return null; return new PlaceOfInterestCategory(placeOfInterestCategory.Id, placeOfInterestCategory.Category, placeOfInterestCategory.ImageBinary, placeOfInterestCategory.IsChecked); }
public static PlaceOfInterestCategory Create(DrumbleApp.Shared.Entities.PlaceOfInterestCategory placeOfInterestCategory) { if (placeOfInterestCategory == null) throw new ArgumentNullException("placeOfInterestCategory"); return new PlaceOfInterestCategory(placeOfInterestCategory.Id, placeOfInterestCategory.Category, placeOfInterestCategory.ImageBinary); }
public static User Create(DrumbleApp.Shared.Data.Models.User user) { if (user == null) { throw new ArgumentNullException("user"); } return new User(user.Id, new ValueObjects.Token(user.Token), CreateCountry(user.CountryCode, user.CountryName), user.DismissedLocationPopup, new Coordinate(user.Latitude, user.Longitude), user.LastLocationUpdate, user.DismissedRateAppPopup, user.DismissedSignUpPopup, user.IsBumbleRegistered, (string.IsNullOrEmpty(user.Email)) ? null : new Email(user.Email), user.FirstName, user.LastName, user.IsFacebookRegistered, user.IsTwitterRegistered, (!user.IsFacebookRegistered) ? null : new FacebookInfo(user.FacebookAccessToken, user.FacebookId), (!user.IsTwitterRegistered) ? null : new TwitterInfo(user.TwitterAccessToken, user.TwitterAccessTokenSecret, user.TwitterId), user.TwitterHandle, user.AppUsageCount, user.DismissedLoginUberPopup, (!user.IsUberAuthenticated) ? null : new UberInfo(user.UberAccessToken, user.UberRefreshToken), user.IsUberAuthenticated); }
public static SearchItemCategory Create(DrumbleApp.Shared.Data.Models.SearchItemCategory searchItemCategory) { if (searchItemCategory == null) { throw new ArgumentNullException("searchItemCategory"); } return new SearchItemCategory(searchItemCategory.Id, searchItemCategory.ImageBinary, searchItemCategory.Text); }
public static AppSetting Create(DrumbleApp.Shared.Data.Models.AppSetting appSetting) { if (appSetting == null) { throw new ArgumentNullException("appSetting"); } return new AppSetting(appSetting.Id, appSetting.ApplicationSetting, appSetting.SettingValue); }
public static User Create(DrumbleApp.Shared.Entities.User user) { if (user == null) { throw new ArgumentNullException("user"); } return new User(user.Id, user.Token.Value, (user.Country == null) ? null : user.Country.Code, (user.Country == null) ? null : user.Country.Name, user.DismissedLocationPopup, (user.LastKnownGeneralLocation == null) ? Double.NaN : user.LastKnownGeneralLocation.Latitude, (user.LastKnownGeneralLocation == null) ? Double.NaN : user.LastKnownGeneralLocation.Longitude, user.LastLocationUpdate, user.DismissedRateAppPopup, user.DismissedSignUpPopup, user.IsBumbleRegistered, (user.Email == null) ? string.Empty : user.Email.EmailAddress, user.IsFacebookRegistered, user.IsTwitterRegistered, user.FirstName, user.LastName, (user.FacebookInfo == null) ? null : user.FacebookInfo.FacebookId, (user.FacebookInfo == null) ? null : user.FacebookInfo.AccessToken, (user.TwitterInfo == null) ? null : user.TwitterInfo.AccessToken, (user.TwitterInfo == null) ? null : user.TwitterInfo.AccessTokenSecret, (user.TwitterInfo == null) ? null : user.TwitterInfo.TwitterId, user.TwitterHandle, user.AppUsageCount, user.DismissedLoginUberPopup, (user.UberInfo == null) ? null : user.UberInfo.AccessToken, (user.UberInfo == null) ? null : user.UberInfo.RefreshToken, user.IsUberAuthenticated); }
public static PublicTransportOperator Create(DrumbleApp.Shared.Data.Models.PublicTransportOperator publicTransportOperator) { if (publicTransportOperator == null) { throw new ArgumentNullException("publicTransportOperator"); } PublicTransportOperator modelPublicTransportOperator = new PublicTransportOperator(publicTransportOperator.Id, publicTransportOperator.Name, publicTransportOperator.DisplayName, publicTransportOperator.Category, publicTransportOperator.RouteImageUrl, publicTransportOperator.TwitterHandle, publicTransportOperator.FacebookPage, publicTransportOperator.WebsiteAddress, publicTransportOperator.ContactEmail, publicTransportOperator.ContactNumber, publicTransportOperator.IsPublic); return modelPublicTransportOperator; }
public static CacheSetting Create(DrumbleApp.Shared.Data.Models.CacheSetting cacheSetting) { if (cacheSetting == null) return null; return new CacheSetting(cacheSetting.Id, cacheSetting.LastRefreshedDateUtc, cacheSetting.ResourceType); }
public static Weather Create(DrumbleApp.Shared.Data.Models.Weather weather) { if (weather == null) return null; return new Weather(weather.Id, weather.Icon, weather.LastRefreshedDate); }
public static CacheSetting Create(DrumbleApp.Shared.Entities.CacheSetting cacheSetting) { if (cacheSetting == null) { throw new ArgumentNullException("cacheSetting"); } return new CacheSetting(cacheSetting.Id, cacheSetting.ResourceType, cacheSetting.LastRefreshedDateUtc, cacheSetting.CacheValidDurationInSeconds); }