<?xml version="1.0" encoding="utf-8"?>
<edmx:Edmx Version="4.0" xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx">
 <edmx:DataServices>
  <Schema Namespace="VehicleDb" xmlns="http://docs.oasis-open.org/odata/ns/edm">
   <EntityType Name="Reference">
    <Key><PropertyRef Name="Code"/></Key>
    <Property Name="Code" Type="Edm.String" Nullable="false"/>
    <Property Name="Month" Type="Edm.String"/>
   </EntityType>
   <EntityType Name="Brand">
    <Key><PropertyRef Name="Id"/></Key>
    <Property Name="Id" Type="Edm.String" Nullable="false"/>
    <Property Name="VehicleType" Type="Edm.String"/>
    <Property Name="VehicleTypeId" Type="Edm.Int32"/>
    <Property Name="Code" Type="Edm.String"/>
    <Property Name="Name" Type="Edm.String"/>
    <NavigationProperty Name="Models" Type="Collection(VehicleDb.Model)" Partner="Brand"/>
   </EntityType>
   <EntityType Name="Model">
    <Key><PropertyRef Name="Id"/></Key>
    <Property Name="Id" Type="Edm.String" Nullable="false"/>
    <Property Name="BrandId" Type="Edm.String"/>
    <Property Name="BrandName" Type="Edm.String"/>
    <Property Name="VehicleType" Type="Edm.String"/>
    <Property Name="Code" Type="Edm.String"/>
    <Property Name="Name" Type="Edm.String"/>
    <NavigationProperty Name="Brand" Type="VehicleDb.Brand" Nullable="false" Partner="Models">
     <ReferentialConstraint Property="BrandId" ReferencedProperty="Id"/>
    </NavigationProperty>
    <NavigationProperty Name="Vehicles" Type="Collection(VehicleDb.Vehicle)" Partner="Model"/>
   </EntityType>
   <EntityType Name="Vehicle">
    <Key><PropertyRef Name="Id"/></Key>
    <Property Name="Id" Type="Edm.String" Nullable="false"/>
    <Property Name="ModelId" Type="Edm.String"/>
    <Property Name="VehicleType" Type="Edm.String"/>
    <Property Name="VehicleTypeId" Type="Edm.Int32"/>
    <Property Name="BrandName" Type="Edm.String"/>
    <Property Name="ModelName" Type="Edm.String"/>
    <Property Name="ModelYear" Type="Edm.Int32"/>
    <Property Name="YearCode" Type="Edm.String"/>
    <Property Name="YearName" Type="Edm.String"/>
    <Property Name="Fuel" Type="Edm.String"/>
    <Property Name="FuelAcronym" Type="Edm.String"/>
    <Property Name="CodeFipe" Type="Edm.String"/>
    <Property Name="Price" Type="Edm.Decimal" Precision="14" Scale="2"/>
    <Property Name="PriceFormatted" Type="Edm.String"/>
    <Property Name="ReferenceCode" Type="Edm.String"/>
    <Property Name="ReferenceMonth" Type="Edm.String"/>
    <NavigationProperty Name="Model" Type="VehicleDb.Model" Nullable="false" Partner="Vehicles">
     <ReferentialConstraint Property="ModelId" ReferencedProperty="Id"/>
    </NavigationProperty>
    <NavigationProperty Name="PriceHistory" Type="Collection(VehicleDb.PriceEntry)" Partner="Vehicle"/>
   </EntityType>
   <EntityType Name="PriceEntry">
    <Key><PropertyRef Name="Id"/></Key>
    <Property Name="Id" Type="Edm.String" Nullable="false"/>
    <Property Name="VehicleId" Type="Edm.String"/>
    <Property Name="CodeFipe" Type="Edm.String"/>
    <Property Name="Reference" Type="Edm.String"/>
    <Property Name="Month" Type="Edm.String"/>
    <Property Name="Price" Type="Edm.Decimal" Precision="14" Scale="2"/>
    <Property Name="PriceFormatted" Type="Edm.String"/>
    <NavigationProperty Name="Vehicle" Type="VehicleDb.Vehicle" Nullable="false" Partner="PriceHistory">
     <ReferentialConstraint Property="VehicleId" ReferencedProperty="Id"/>
    </NavigationProperty>
   </EntityType>
   <EntityContainer Name="Container">
    <EntitySet Name="References" EntityType="VehicleDb.Reference">
    </EntitySet>
    <EntitySet Name="Brands" EntityType="VehicleDb.Brand">
     <NavigationPropertyBinding Path="Models" Target="Models"/>
    </EntitySet>
    <EntitySet Name="Models" EntityType="VehicleDb.Model">
     <NavigationPropertyBinding Path="Brand" Target="Brands"/>
     <NavigationPropertyBinding Path="Vehicles" Target="Vehicles"/>
    </EntitySet>
    <EntitySet Name="Vehicles" EntityType="VehicleDb.Vehicle">
     <NavigationPropertyBinding Path="Model" Target="Models"/>
     <NavigationPropertyBinding Path="PriceHistory" Target="PriceHistory"/>
    </EntitySet>
    <EntitySet Name="PriceHistory" EntityType="VehicleDb.PriceEntry">
     <NavigationPropertyBinding Path="Vehicle" Target="Vehicles"/>
    </EntitySet>
   </EntityContainer>
  </Schema>
 </edmx:DataServices>
</edmx:Edmx>
