LocalBusiness Microdata JSON structure using c#
Example of C# code for defining LocalBusiness Microdata structure using MXTires.Microdata library:
[TestMethod]
public void LocalBusinessTest()
{
LocalBusiness shop = new LocalBusiness()
{
Name = “1010Tires.com”,
Description = “Sell Wheels and Tires.”,
CurrenciesAccepted = “USD, CAD”,
};
Language language = new Language() { Name = “English, French” }; //may need more differentiation
shop.Address = new PostalAddress()
{
AddressCountry = “CA”,
AddressRegion = “BC”,
AddressLocality = “Vancouver”,
PostalCode = “V5X 2T7”,
StreetAddress = “732 Southeast Marine Drive”,
AreaServed = “Vancouver”,
AvailableLanguage = language,
Email = “[email protected]”,
Telephone = “604-324-5999”,
};
shop.Location = new Place();
shop.Location.Geo = new GeoCoordinates(“49.210978”, “-123.089581”);
OpeningHoursSpecification mondayHours = new OpeningHoursSpecification(“5:30 PM”, DaysOfWeek.Mo,”9:00 AM”);
shop.Location.OpeningHoursSpecification = new List<OpeningHoursSpecification>();
shop.Location.OpeningHoursSpecification.Add(mondayHours);
System.Diagnostics.Debug.Write(shop.ToJson());
}