public static string AddressRemove(this UrlHelper urlHelper, AddressPart part)
 {
     return urlHelper.Action("Remove", "AddressAdmin", new { id = part.Get<IdentityPart>().Identifier, area = "Orchard.CalendarEvents" });
 }
        //public EventAddress GetEventAddressByLocationName(string locationName)
        //{
        //    var model = GetByLocationName(locationName);
        //    return GetEventAddress(model);
        //}

        //public EventAddress GetEventAddressByIdentity(string identifier)
        //{
        //    AddressPart model = GetByIdentity(identifier);
        //    var data = GetEventAddress(model);
        //    return data;
        //}

        //public EventAddress GetEventAddress(AddressPart model)
        //{
        //    var part = new EventAddress();
        //    if (model == null) return part;
        //    part.AddressId = model.Identifier;
        //    part.LocationName = model.LocationName;
        //    part.MapEmbedCode = model.MapEmbedCode;
        //    part.StreetAddress1 = model.StreetAddress1;
        //    part.StreetAddress2 = model.StreetAddress2;
        //    part.StreetAddress3 = model.StreetAddress3;
        //    part.City = model.City;
        //    part.State = model.State;
        //    part.Zip = model.Zip;
        //    part.Country = model.Country;
        //    return part;
        //}

        //public IEnumerable<EventAddress> GetEventAddresses(VersionOptions version = null)
        //{
        //    var data = GetAddressParts(version).Select(GetEventAddress);
        //    return data;
        //}

        //public void UpdateAddressPartFromEventAddress(AddressPart part, EventAddress model)
        //{
        //    if(model==null) return;
            
        //    part.LocationName = model.LocationName;
        //    part.MapEmbedCode = model.MapEmbedCode;
        //    part.StreetAddress1 = model.StreetAddress1;
        //    part.StreetAddress2 = model.StreetAddress2;
        //    part.StreetAddress3 = model.StreetAddress3;
        //    part.City = model.City;
        //    part.State = model.State;
        //    part.Zip = model.Zip;
        //    part.Country = model.Country;
        //}

        //public string CreateAddress(EventAddress address)
        //{
        //    if (!string.IsNullOrWhiteSpace(address.AddressId))
        //    {
        //        return null;
        //    }

        //    var item = Services.ContentManager.New<AddressPart>("Address");
        //    _contentManager.Create(item, VersionOptions.Draft);
        //    var model = item.ContentItem.As<AddressPart>();
        //    UpdateAddressPartFromEventAddress(model,address);
        //    _contentManager.Publish(model.ContentItem);
        //    return model.ContentItem.Get<IdentityPart>().Identifier;
        //}

        public void UpdateEventForContentItem(ContentItem item, AddressPart model)
        {
            var part = item.As<AddressPart>();
            part.LocationName = model.LocationName;
            part.MapEmbedCode = model.MapEmbedCode;
            part.StreetAddress1 = model.StreetAddress1;
            part.StreetAddress2 = model.StreetAddress2;
            part.StreetAddress3 = model.StreetAddress3;
            part.City = model.City;
            part.State = model.State;
            part.Zip = model.Zip;
            part.Country = model.Country;

        }