public static Search.Models.Origin AsSearchModel(this Models.Origin source) => new Search.Models.Origin { Id = source.OriginId, ParentOrigin = source.ParentOrigin?.AsSearchModel(), Location = source.Location?.AsSearchModel(), Name = source.Name, Description = source.Description, Type = source.Type.ToString(), Latitude = source.Location?.Latitude, Longitude = source.Location?.Longitude, Uri = source.Uri?.ToString(), Authors = source.Authors, ExternalId = source.ExternalId, AltExternalId = source.AltExternalId, Visibility = source.Visibility, User = source.User?.AsSearchModel(), CreatedBy = source.CreatedBy, ModifiedBy = source.ModifiedBy, DateCreated = source.DateCreated ?? DateTime.UtcNow, DateModified = source.DateModified };
public static Origin AsStore(this Models.Origin source) => new Origin { Id = source.OriginId, ParentOriginId = source.ParentOrigin != null ? (int?)source.ParentOrigin.OriginId : null, LocationId = source.Location?.LocationId ?? source.LocationId, Name = source.Name, Description = source.Description, Type = source.Type.ToString(), Latitude = source.Location?.Latitude, Longitude = source.Location?.Longitude, Uri = source.Uri, Authors = source.Authors, ExternalId = source.ExternalId, AltExternalId = source.AltExternalId, Visibility = source.Visibility, UserId = source.UserId, CreatedBy = source.CreatedBy, ModifiedBy = source.ModifiedBy, DateCreated = source.DateCreated ?? DateTime.UtcNow, DateModified = source.DateModified };