Skip to content

Instantly share code, notes, and snippets.

@natemcmaster
Created October 23, 2015 22:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save natemcmaster/8773c58c63946ecec96b to your computer and use it in GitHub Desktop.
Save natemcmaster/8773c58c63946ecec96b to your computer and use it in GitHub Desktop.
AdventureWorks with attributes
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("Address", Schema = "Person")]
public partial class Address
{
public Address()
{
BusinessEntityAddress = new HashSet<BusinessEntityAddress>();
SalesOrderHeader = new HashSet<SalesOrderHeader>();
SalesOrderHeaderNavigation = new HashSet<SalesOrderHeader>();
}
public int AddressID { get; set; }
[Required]
[MaxLength(60)]
public string AddressLine1 { get; set; }
[MaxLength(60)]
public string AddressLine2 { get; set; }
[Required]
[MaxLength(30)]
public string City { get; set; }
public DateTime ModifiedDate { get; set; }
[Required]
[MaxLength(15)]
public string PostalCode { get; set; }
public Guid rowguid { get; set; }
public int StateProvinceID { get; set; }
[InverseProperty("Address")]
public virtual ICollection<BusinessEntityAddress> BusinessEntityAddress { get; set; }
[InverseProperty("BillToAddress")]
public virtual ICollection<SalesOrderHeader> SalesOrderHeader { get; set; }
[InverseProperty("ShipToAddress")]
public virtual ICollection<SalesOrderHeader> SalesOrderHeaderNavigation { get; set; }
[ForeignKey("StateProvinceID")]
[InverseProperty("Address")]
public virtual StateProvince StateProvince { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("AddressType", Schema = "Person")]
public partial class AddressType
{
public AddressType()
{
BusinessEntityAddress = new HashSet<BusinessEntityAddress>();
}
public int AddressTypeID { get; set; }
public DateTime ModifiedDate { get; set; }
public Guid rowguid { get; set; }
[InverseProperty("AddressType")]
public virtual ICollection<BusinessEntityAddress> BusinessEntityAddress { get; set; }
}
}
using Microsoft.Data.Entity;
using Microsoft.Data.Entity.Metadata;
namespace ConsoleApplication.av
{
public partial class AdventureWorks2014Context : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder options)
{
options.UseSqlServer(@"Server=.\sqlexpress;Integrated Security=true;Database=AdventureWorks2014");
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<AWBuildVersion>(entity =>
{
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
entity.Property(e => e.VersionDate).HasColumnType("datetime");
});
modelBuilder.Entity<Address>(entity =>
{
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
entity.Property(e => e.rowguid).HasDefaultValueSql("newid()");
});
modelBuilder.Entity<AddressType>(entity =>
{
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
entity.Property(e => e.rowguid).HasDefaultValueSql("newid()");
});
modelBuilder.Entity<BillOfMaterials>(entity =>
{
entity.Property(e => e.EndDate).HasColumnType("datetime");
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
entity.Property(e => e.PerAssemblyQty)
.HasColumnType("decimal")
.HasDefaultValue(1.00m);
entity.Property(e => e.StartDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
entity.Property(e => e.UnitMeasureCode).HasColumnType("nchar");
});
modelBuilder.Entity<BusinessEntity>(entity =>
{
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
entity.Property(e => e.rowguid).HasDefaultValueSql("newid()");
});
modelBuilder.Entity<BusinessEntityAddress>(entity =>
{
entity.HasKey(e => new { e.BusinessEntityID, e.AddressID, e.AddressTypeID });
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
entity.Property(e => e.rowguid).HasDefaultValueSql("newid()");
});
modelBuilder.Entity<BusinessEntityContact>(entity =>
{
entity.HasKey(e => new { e.BusinessEntityID, e.PersonID, e.ContactTypeID });
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
entity.Property(e => e.rowguid).HasDefaultValueSql("newid()");
});
modelBuilder.Entity<ContactType>(entity =>
{
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
});
modelBuilder.Entity<CountryRegion>(entity =>
{
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
});
modelBuilder.Entity<CountryRegionCurrency>(entity =>
{
entity.HasKey(e => new { e.CountryRegionCode, e.CurrencyCode });
entity.Property(e => e.CurrencyCode).HasColumnType("nchar");
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
});
modelBuilder.Entity<CreditCard>(entity =>
{
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
});
modelBuilder.Entity<Culture>(entity =>
{
entity.Property(e => e.CultureID).HasColumnType("nchar");
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
});
modelBuilder.Entity<Currency>(entity =>
{
entity.Property(e => e.CurrencyCode).HasColumnType("nchar");
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
});
modelBuilder.Entity<CurrencyRate>(entity =>
{
entity.Property(e => e.AverageRate).HasColumnType("money");
entity.Property(e => e.CurrencyRateDate).HasColumnType("datetime");
entity.Property(e => e.EndOfDayRate).HasColumnType("money");
entity.Property(e => e.FromCurrencyCode).HasColumnType("nchar");
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
entity.Property(e => e.ToCurrencyCode).HasColumnType("nchar");
});
modelBuilder.Entity<Customer>(entity =>
{
entity.Property(e => e.AccountNumber)
.HasColumnType("varchar")
.ValueGeneratedOnAddOrUpdate();
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
entity.Property(e => e.rowguid).HasDefaultValueSql("newid()");
});
modelBuilder.Entity<DatabaseLog>(entity =>
{
entity.Property(e => e.PostTime).HasColumnType("datetime");
});
modelBuilder.Entity<Department>(entity =>
{
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
});
modelBuilder.Entity<EmailAddress>(entity =>
{
entity.HasKey(e => new { e.BusinessEntityID, e.EmailAddressID });
entity.Property(e => e.EmailAddressID).ValueGeneratedOnAdd();
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
entity.Property(e => e.rowguid).HasDefaultValueSql("newid()");
});
modelBuilder.Entity<Employee>(entity =>
{
entity.Property(e => e.BusinessEntityID).ValueGeneratedNever();
entity.Property(e => e.BirthDate).HasColumnType("date");
entity.Property(e => e.Gender).HasColumnType("nchar");
entity.Property(e => e.HireDate).HasColumnType("date");
entity.Property(e => e.MaritalStatus).HasColumnType("nchar");
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
entity.Property(e => e.OrganizationLevel).ValueGeneratedOnAddOrUpdate();
entity.Property(e => e.rowguid).HasDefaultValueSql("newid()");
entity.Property(e => e.SickLeaveHours).HasDefaultValue(0);
entity.Property(e => e.VacationHours).HasDefaultValue(0);
});
modelBuilder.Entity<EmployeeDepartmentHistory>(entity =>
{
entity.HasKey(e => new { e.BusinessEntityID, e.StartDate, e.DepartmentID, e.ShiftID });
entity.Property(e => e.StartDate).HasColumnType("date");
entity.Property(e => e.EndDate).HasColumnType("date");
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
});
modelBuilder.Entity<EmployeePayHistory>(entity =>
{
entity.HasKey(e => new { e.BusinessEntityID, e.RateChangeDate });
entity.Property(e => e.RateChangeDate).HasColumnType("datetime");
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
entity.Property(e => e.Rate).HasColumnType("money");
});
modelBuilder.Entity<ErrorLog>(entity =>
{
entity.Property(e => e.ErrorTime)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
});
modelBuilder.Entity<Illustration>(entity =>
{
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
});
modelBuilder.Entity<JobCandidate>(entity =>
{
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
});
modelBuilder.Entity<Location>(entity =>
{
entity.Property(e => e.Availability)
.HasColumnType("decimal")
.HasDefaultValue(0.00m);
entity.Property(e => e.CostRate)
.HasColumnType("smallmoney")
.HasDefaultValue(0.00m);
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
});
modelBuilder.Entity<Password>(entity =>
{
entity.Property(e => e.BusinessEntityID).ValueGeneratedNever();
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
entity.Property(e => e.PasswordHash).HasColumnType("varchar");
entity.Property(e => e.PasswordSalt).HasColumnType("varchar");
entity.Property(e => e.rowguid).HasDefaultValueSql("newid()");
});
modelBuilder.Entity<Person>(entity =>
{
entity.Property(e => e.BusinessEntityID).ValueGeneratedNever();
entity.Property(e => e.EmailPromotion).HasDefaultValue(0);
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
entity.Property(e => e.PersonType).HasColumnType("nchar");
entity.Property(e => e.rowguid).HasDefaultValueSql("newid()");
});
modelBuilder.Entity<PersonCreditCard>(entity =>
{
entity.HasKey(e => new { e.BusinessEntityID, e.CreditCardID });
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
});
modelBuilder.Entity<PhoneNumberType>(entity =>
{
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
});
modelBuilder.Entity<Product>(entity =>
{
entity.Property(e => e.Class).HasColumnType("nchar");
entity.Property(e => e.DiscontinuedDate).HasColumnType("datetime");
entity.Property(e => e.ListPrice).HasColumnType("money");
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
entity.Property(e => e.ProductLine).HasColumnType("nchar");
entity.Property(e => e.rowguid).HasDefaultValueSql("newid()");
entity.Property(e => e.SellEndDate).HasColumnType("datetime");
entity.Property(e => e.SellStartDate).HasColumnType("datetime");
entity.Property(e => e.SizeUnitMeasureCode).HasColumnType("nchar");
entity.Property(e => e.StandardCost).HasColumnType("money");
entity.Property(e => e.Style).HasColumnType("nchar");
entity.Property(e => e.Weight).HasColumnType("decimal");
entity.Property(e => e.WeightUnitMeasureCode).HasColumnType("nchar");
});
modelBuilder.Entity<ProductCategory>(entity =>
{
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
entity.Property(e => e.rowguid).HasDefaultValueSql("newid()");
});
modelBuilder.Entity<ProductCostHistory>(entity =>
{
entity.HasKey(e => new { e.ProductID, e.StartDate });
entity.Property(e => e.StartDate).HasColumnType("datetime");
entity.Property(e => e.EndDate).HasColumnType("datetime");
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
entity.Property(e => e.StandardCost).HasColumnType("money");
});
modelBuilder.Entity<ProductDescription>(entity =>
{
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
entity.Property(e => e.rowguid).HasDefaultValueSql("newid()");
});
modelBuilder.Entity<ProductInventory>(entity =>
{
entity.HasKey(e => new { e.ProductID, e.LocationID });
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
entity.Property(e => e.Quantity).HasDefaultValue(0);
entity.Property(e => e.rowguid).HasDefaultValueSql("newid()");
});
modelBuilder.Entity<ProductListPriceHistory>(entity =>
{
entity.HasKey(e => new { e.ProductID, e.StartDate });
entity.Property(e => e.StartDate).HasColumnType("datetime");
entity.Property(e => e.EndDate).HasColumnType("datetime");
entity.Property(e => e.ListPrice).HasColumnType("money");
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
});
modelBuilder.Entity<ProductModel>(entity =>
{
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
entity.Property(e => e.rowguid).HasDefaultValueSql("newid()");
});
modelBuilder.Entity<ProductModelIllustration>(entity =>
{
entity.HasKey(e => new { e.ProductModelID, e.IllustrationID });
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
});
modelBuilder.Entity<ProductModelProductDescriptionCulture>(entity =>
{
entity.HasKey(e => new { e.ProductModelID, e.ProductDescriptionID, e.CultureID });
entity.Property(e => e.CultureID).HasColumnType("nchar");
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
});
modelBuilder.Entity<ProductPhoto>(entity =>
{
entity.Property(e => e.LargePhoto).HasColumnType("varbinary");
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
entity.Property(e => e.ThumbNailPhoto).HasColumnType("varbinary");
});
modelBuilder.Entity<ProductProductPhoto>(entity =>
{
entity.HasKey(e => new { e.ProductID, e.ProductPhotoID });
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
});
modelBuilder.Entity<ProductReview>(entity =>
{
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
entity.Property(e => e.ReviewDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
});
modelBuilder.Entity<ProductSubcategory>(entity =>
{
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
entity.Property(e => e.rowguid).HasDefaultValueSql("newid()");
});
modelBuilder.Entity<ProductVendor>(entity =>
{
entity.HasKey(e => new { e.ProductID, e.BusinessEntityID });
entity.Property(e => e.LastReceiptCost).HasColumnType("money");
entity.Property(e => e.LastReceiptDate).HasColumnType("datetime");
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
entity.Property(e => e.StandardPrice).HasColumnType("money");
entity.Property(e => e.UnitMeasureCode).HasColumnType("nchar");
});
modelBuilder.Entity<PurchaseOrderDetail>(entity =>
{
entity.HasKey(e => new { e.PurchaseOrderID, e.PurchaseOrderDetailID });
entity.Property(e => e.PurchaseOrderDetailID).ValueGeneratedOnAdd();
entity.Property(e => e.DueDate).HasColumnType("datetime");
entity.Property(e => e.LineTotal)
.HasColumnType("money")
.ValueGeneratedOnAddOrUpdate();
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
entity.Property(e => e.ReceivedQty).HasColumnType("decimal");
entity.Property(e => e.RejectedQty).HasColumnType("decimal");
entity.Property(e => e.StockedQty)
.HasColumnType("decimal")
.ValueGeneratedOnAddOrUpdate();
entity.Property(e => e.UnitPrice).HasColumnType("money");
});
modelBuilder.Entity<PurchaseOrderHeader>(entity =>
{
entity.Property(e => e.Freight)
.HasColumnType("money")
.HasDefaultValue(0.00m);
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
entity.Property(e => e.OrderDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
entity.Property(e => e.RevisionNumber).HasDefaultValue(0);
entity.Property(e => e.ShipDate).HasColumnType("datetime");
entity.Property(e => e.Status).HasDefaultValue(1);
entity.Property(e => e.SubTotal)
.HasColumnType("money")
.HasDefaultValue(0.00m);
entity.Property(e => e.TaxAmt)
.HasColumnType("money")
.HasDefaultValue(0.00m);
entity.Property(e => e.TotalDue)
.HasColumnType("money")
.ValueGeneratedOnAddOrUpdate();
});
modelBuilder.Entity<SalesOrderDetail>(entity =>
{
entity.HasKey(e => new { e.SalesOrderID, e.SalesOrderDetailID });
entity.Property(e => e.SalesOrderDetailID).ValueGeneratedOnAdd();
entity.Property(e => e.LineTotal)
.HasColumnType("numeric")
.ValueGeneratedOnAddOrUpdate();
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
entity.Property(e => e.rowguid).HasDefaultValueSql("newid()");
entity.Property(e => e.UnitPrice).HasColumnType("money");
entity.Property(e => e.UnitPriceDiscount)
.HasColumnType("money")
.HasDefaultValue(0.0m);
});
modelBuilder.Entity<SalesOrderHeader>(entity =>
{
entity.Property(e => e.CreditCardApprovalCode).HasColumnType("varchar");
entity.Property(e => e.DueDate).HasColumnType("datetime");
entity.Property(e => e.Freight)
.HasColumnType("money")
.HasDefaultValue(0.00m);
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
entity.Property(e => e.OrderDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
entity.Property(e => e.RevisionNumber).HasDefaultValue(0);
entity.Property(e => e.rowguid).HasDefaultValueSql("newid()");
entity.Property(e => e.SalesOrderNumber).ValueGeneratedOnAddOrUpdate();
entity.Property(e => e.ShipDate).HasColumnType("datetime");
entity.Property(e => e.Status).HasDefaultValue(1);
entity.Property(e => e.SubTotal)
.HasColumnType("money")
.HasDefaultValue(0.00m);
entity.Property(e => e.TaxAmt)
.HasColumnType("money")
.HasDefaultValue(0.00m);
entity.Property(e => e.TotalDue)
.HasColumnType("money")
.ValueGeneratedOnAddOrUpdate();
});
modelBuilder.Entity<SalesOrderHeaderSalesReason>(entity =>
{
entity.HasKey(e => new { e.SalesOrderID, e.SalesReasonID });
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
});
modelBuilder.Entity<SalesPerson>(entity =>
{
entity.Property(e => e.BusinessEntityID).ValueGeneratedNever();
entity.Property(e => e.Bonus)
.HasColumnType("money")
.HasDefaultValue(0.00m);
entity.Property(e => e.CommissionPct)
.HasColumnType("smallmoney")
.HasDefaultValue(0.00m);
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
entity.Property(e => e.rowguid).HasDefaultValueSql("newid()");
entity.Property(e => e.SalesLastYear)
.HasColumnType("money")
.HasDefaultValue(0.00m);
entity.Property(e => e.SalesQuota).HasColumnType("money");
entity.Property(e => e.SalesYTD)
.HasColumnType("money")
.HasDefaultValue(0.00m);
});
modelBuilder.Entity<SalesPersonQuotaHistory>(entity =>
{
entity.HasKey(e => new { e.BusinessEntityID, e.QuotaDate });
entity.Property(e => e.QuotaDate).HasColumnType("datetime");
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
entity.Property(e => e.rowguid).HasDefaultValueSql("newid()");
entity.Property(e => e.SalesQuota).HasColumnType("money");
});
modelBuilder.Entity<SalesReason>(entity =>
{
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
});
modelBuilder.Entity<SalesTaxRate>(entity =>
{
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
entity.Property(e => e.rowguid).HasDefaultValueSql("newid()");
entity.Property(e => e.TaxRate)
.HasColumnType("smallmoney")
.HasDefaultValue(0.00m);
});
modelBuilder.Entity<SalesTerritory>(entity =>
{
entity.Property(e => e.CostLastYear)
.HasColumnType("money")
.HasDefaultValue(0.00m);
entity.Property(e => e.CostYTD)
.HasColumnType("money")
.HasDefaultValue(0.00m);
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
entity.Property(e => e.rowguid).HasDefaultValueSql("newid()");
entity.Property(e => e.SalesLastYear)
.HasColumnType("money")
.HasDefaultValue(0.00m);
entity.Property(e => e.SalesYTD)
.HasColumnType("money")
.HasDefaultValue(0.00m);
});
modelBuilder.Entity<SalesTerritoryHistory>(entity =>
{
entity.HasKey(e => new { e.BusinessEntityID, e.StartDate, e.TerritoryID });
entity.Property(e => e.StartDate).HasColumnType("datetime");
entity.Property(e => e.EndDate).HasColumnType("datetime");
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
entity.Property(e => e.rowguid).HasDefaultValueSql("newid()");
});
modelBuilder.Entity<ScrapReason>(entity =>
{
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
});
modelBuilder.Entity<Shift>(entity =>
{
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
});
modelBuilder.Entity<ShipMethod>(entity =>
{
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
entity.Property(e => e.rowguid).HasDefaultValueSql("newid()");
entity.Property(e => e.ShipBase)
.HasColumnType("money")
.HasDefaultValue(0.00m);
entity.Property(e => e.ShipRate)
.HasColumnType("money")
.HasDefaultValue(0.00m);
});
modelBuilder.Entity<ShoppingCartItem>(entity =>
{
entity.Property(e => e.DateCreated)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
entity.Property(e => e.Quantity).HasDefaultValue(1);
});
modelBuilder.Entity<SpecialOffer>(entity =>
{
entity.Property(e => e.DiscountPct)
.HasColumnType("smallmoney")
.HasDefaultValue(0.00m);
entity.Property(e => e.EndDate).HasColumnType("datetime");
entity.Property(e => e.MinQty).HasDefaultValue(0);
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
entity.Property(e => e.rowguid).HasDefaultValueSql("newid()");
entity.Property(e => e.StartDate).HasColumnType("datetime");
});
modelBuilder.Entity<SpecialOfferProduct>(entity =>
{
entity.HasKey(e => new { e.SpecialOfferID, e.ProductID });
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
entity.Property(e => e.rowguid).HasDefaultValueSql("newid()");
});
modelBuilder.Entity<StateProvince>(entity =>
{
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
entity.Property(e => e.rowguid).HasDefaultValueSql("newid()");
entity.Property(e => e.StateProvinceCode).HasColumnType("nchar");
});
modelBuilder.Entity<Store>(entity =>
{
entity.Property(e => e.BusinessEntityID).ValueGeneratedNever();
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
entity.Property(e => e.rowguid).HasDefaultValueSql("newid()");
});
modelBuilder.Entity<TransactionHistory>(entity =>
{
entity.Property(e => e.ActualCost).HasColumnType("money");
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
entity.Property(e => e.ReferenceOrderLineID).HasDefaultValue(0);
entity.Property(e => e.TransactionDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
entity.Property(e => e.TransactionType).HasColumnType("nchar");
});
modelBuilder.Entity<TransactionHistoryArchive>(entity =>
{
entity.Property(e => e.TransactionID).ValueGeneratedNever();
entity.Property(e => e.ActualCost).HasColumnType("money");
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
entity.Property(e => e.ReferenceOrderLineID).HasDefaultValue(0);
entity.Property(e => e.TransactionDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
entity.Property(e => e.TransactionType).HasColumnType("nchar");
});
modelBuilder.Entity<UnitMeasure>(entity =>
{
entity.Property(e => e.UnitMeasureCode).HasColumnType("nchar");
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
});
modelBuilder.Entity<Vendor>(entity =>
{
entity.Property(e => e.BusinessEntityID).ValueGeneratedNever();
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
});
modelBuilder.Entity<WorkOrder>(entity =>
{
entity.Property(e => e.DueDate).HasColumnType("datetime");
entity.Property(e => e.EndDate).HasColumnType("datetime");
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
entity.Property(e => e.StartDate).HasColumnType("datetime");
entity.Property(e => e.StockedQty).ValueGeneratedOnAddOrUpdate();
});
modelBuilder.Entity<WorkOrderRouting>(entity =>
{
entity.HasKey(e => new { e.WorkOrderID, e.ProductID, e.OperationSequence });
entity.Property(e => e.ActualCost).HasColumnType("money");
entity.Property(e => e.ActualEndDate).HasColumnType("datetime");
entity.Property(e => e.ActualResourceHrs).HasColumnType("decimal");
entity.Property(e => e.ActualStartDate).HasColumnType("datetime");
entity.Property(e => e.ModifiedDate)
.HasColumnType("datetime")
.HasDefaultValueSql("getdate()");
entity.Property(e => e.PlannedCost).HasColumnType("money");
entity.Property(e => e.ScheduledEndDate).HasColumnType("datetime");
entity.Property(e => e.ScheduledStartDate).HasColumnType("datetime");
});
}
public virtual DbSet<AWBuildVersion> AWBuildVersion { get; set; }
public virtual DbSet<Address> Address { get; set; }
public virtual DbSet<AddressType> AddressType { get; set; }
public virtual DbSet<BillOfMaterials> BillOfMaterials { get; set; }
public virtual DbSet<BusinessEntity> BusinessEntity { get; set; }
public virtual DbSet<BusinessEntityAddress> BusinessEntityAddress { get; set; }
public virtual DbSet<BusinessEntityContact> BusinessEntityContact { get; set; }
public virtual DbSet<ContactType> ContactType { get; set; }
public virtual DbSet<CountryRegion> CountryRegion { get; set; }
public virtual DbSet<CountryRegionCurrency> CountryRegionCurrency { get; set; }
public virtual DbSet<CreditCard> CreditCard { get; set; }
public virtual DbSet<Culture> Culture { get; set; }
public virtual DbSet<Currency> Currency { get; set; }
public virtual DbSet<CurrencyRate> CurrencyRate { get; set; }
public virtual DbSet<Customer> Customer { get; set; }
public virtual DbSet<DatabaseLog> DatabaseLog { get; set; }
public virtual DbSet<Department> Department { get; set; }
public virtual DbSet<EmailAddress> EmailAddress { get; set; }
public virtual DbSet<Employee> Employee { get; set; }
public virtual DbSet<EmployeeDepartmentHistory> EmployeeDepartmentHistory { get; set; }
public virtual DbSet<EmployeePayHistory> EmployeePayHistory { get; set; }
public virtual DbSet<ErrorLog> ErrorLog { get; set; }
public virtual DbSet<Illustration> Illustration { get; set; }
public virtual DbSet<JobCandidate> JobCandidate { get; set; }
public virtual DbSet<Location> Location { get; set; }
public virtual DbSet<Password> Password { get; set; }
public virtual DbSet<Person> Person { get; set; }
public virtual DbSet<PersonCreditCard> PersonCreditCard { get; set; }
public virtual DbSet<PhoneNumberType> PhoneNumberType { get; set; }
public virtual DbSet<Product> Product { get; set; }
public virtual DbSet<ProductCategory> ProductCategory { get; set; }
public virtual DbSet<ProductCostHistory> ProductCostHistory { get; set; }
public virtual DbSet<ProductDescription> ProductDescription { get; set; }
public virtual DbSet<ProductInventory> ProductInventory { get; set; }
public virtual DbSet<ProductListPriceHistory> ProductListPriceHistory { get; set; }
public virtual DbSet<ProductModel> ProductModel { get; set; }
public virtual DbSet<ProductModelIllustration> ProductModelIllustration { get; set; }
public virtual DbSet<ProductModelProductDescriptionCulture> ProductModelProductDescriptionCulture { get; set; }
public virtual DbSet<ProductPhoto> ProductPhoto { get; set; }
public virtual DbSet<ProductProductPhoto> ProductProductPhoto { get; set; }
public virtual DbSet<ProductReview> ProductReview { get; set; }
public virtual DbSet<ProductSubcategory> ProductSubcategory { get; set; }
public virtual DbSet<ProductVendor> ProductVendor { get; set; }
public virtual DbSet<PurchaseOrderDetail> PurchaseOrderDetail { get; set; }
public virtual DbSet<PurchaseOrderHeader> PurchaseOrderHeader { get; set; }
public virtual DbSet<SalesOrderDetail> SalesOrderDetail { get; set; }
public virtual DbSet<SalesOrderHeader> SalesOrderHeader { get; set; }
public virtual DbSet<SalesOrderHeaderSalesReason> SalesOrderHeaderSalesReason { get; set; }
public virtual DbSet<SalesPerson> SalesPerson { get; set; }
public virtual DbSet<SalesPersonQuotaHistory> SalesPersonQuotaHistory { get; set; }
public virtual DbSet<SalesReason> SalesReason { get; set; }
public virtual DbSet<SalesTaxRate> SalesTaxRate { get; set; }
public virtual DbSet<SalesTerritory> SalesTerritory { get; set; }
public virtual DbSet<SalesTerritoryHistory> SalesTerritoryHistory { get; set; }
public virtual DbSet<ScrapReason> ScrapReason { get; set; }
public virtual DbSet<Shift> Shift { get; set; }
public virtual DbSet<ShipMethod> ShipMethod { get; set; }
public virtual DbSet<ShoppingCartItem> ShoppingCartItem { get; set; }
public virtual DbSet<SpecialOffer> SpecialOffer { get; set; }
public virtual DbSet<SpecialOfferProduct> SpecialOfferProduct { get; set; }
public virtual DbSet<StateProvince> StateProvince { get; set; }
public virtual DbSet<Store> Store { get; set; }
public virtual DbSet<TransactionHistory> TransactionHistory { get; set; }
public virtual DbSet<TransactionHistoryArchive> TransactionHistoryArchive { get; set; }
public virtual DbSet<UnitMeasure> UnitMeasure { get; set; }
public virtual DbSet<Vendor> Vendor { get; set; }
public virtual DbSet<WorkOrder> WorkOrder { get; set; }
public virtual DbSet<WorkOrderRouting> WorkOrderRouting { get; set; }
// Unable to generate entity type for table 'Production.ProductDocument'.
// Unable to generate entity type for table 'Production.Document'.
// Unable to generate entity type for table 'Person.PersonPhone'.
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
public partial class AWBuildVersion
{
[Key]
public byte SystemInformationID { get; set; }
[Required]
[MaxLength(25)]
[Column("Database Version")]
public string Database_Version { get; set; }
public DateTime ModifiedDate { get; set; }
public DateTime VersionDate { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("BillOfMaterials", Schema = "Production")]
public partial class BillOfMaterials
{
public int BillOfMaterialsID { get; set; }
public short BOMLevel { get; set; }
public int ComponentID { get; set; }
public DateTime? EndDate { get; set; }
public DateTime ModifiedDate { get; set; }
public decimal PerAssemblyQty { get; set; }
public int? ProductAssemblyID { get; set; }
public DateTime StartDate { get; set; }
[Required]
[MaxLength(3)]
public string UnitMeasureCode { get; set; }
[ForeignKey("ComponentID")]
[InverseProperty("BillOfMaterials")]
public virtual Product Component { get; set; }
[ForeignKey("ProductAssemblyID")]
[InverseProperty("BillOfMaterialsNavigation")]
public virtual Product ProductAssembly { get; set; }
[ForeignKey("UnitMeasureCode")]
[InverseProperty("BillOfMaterials")]
public virtual UnitMeasure UnitMeasureCodeNavigation { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("BusinessEntity", Schema = "Person")]
public partial class BusinessEntity
{
public BusinessEntity()
{
BusinessEntityAddress = new HashSet<BusinessEntityAddress>();
BusinessEntityContact = new HashSet<BusinessEntityContact>();
}
public int BusinessEntityID { get; set; }
public DateTime ModifiedDate { get; set; }
public Guid rowguid { get; set; }
[InverseProperty("BusinessEntity")]
public virtual ICollection<BusinessEntityAddress> BusinessEntityAddress { get; set; }
[InverseProperty("BusinessEntity")]
public virtual ICollection<BusinessEntityContact> BusinessEntityContact { get; set; }
[InverseProperty("BusinessEntity")]
public virtual Person Person { get; set; }
[InverseProperty("BusinessEntity")]
public virtual Store Store { get; set; }
[InverseProperty("BusinessEntity")]
public virtual Vendor Vendor { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("BusinessEntityAddress", Schema = "Person")]
public partial class BusinessEntityAddress
{
public int BusinessEntityID { get; set; }
public int AddressID { get; set; }
public int AddressTypeID { get; set; }
public DateTime ModifiedDate { get; set; }
public Guid rowguid { get; set; }
[ForeignKey("AddressID")]
[InverseProperty("BusinessEntityAddress")]
public virtual Address Address { get; set; }
[ForeignKey("AddressTypeID")]
[InverseProperty("BusinessEntityAddress")]
public virtual AddressType AddressType { get; set; }
[ForeignKey("BusinessEntityID")]
[InverseProperty("BusinessEntityAddress")]
public virtual BusinessEntity BusinessEntity { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("BusinessEntityContact", Schema = "Person")]
public partial class BusinessEntityContact
{
public int BusinessEntityID { get; set; }
public int PersonID { get; set; }
public int ContactTypeID { get; set; }
public DateTime ModifiedDate { get; set; }
public Guid rowguid { get; set; }
[ForeignKey("BusinessEntityID")]
[InverseProperty("BusinessEntityContact")]
public virtual BusinessEntity BusinessEntity { get; set; }
[ForeignKey("ContactTypeID")]
[InverseProperty("BusinessEntityContact")]
public virtual ContactType ContactType { get; set; }
[ForeignKey("PersonID")]
[InverseProperty("BusinessEntityContact")]
public virtual Person Person { get; set; }
}
}
Could not find type mapping for column 'Production.ScrapReason.Name' with data type 'Name'. Skipping column.
Unable to scaffold the index 'AK_ScrapReason_Name' because one of the properties it contains could not be scaffolded.
Could not find type mapping for column 'HumanResources.Shift.Name' with data type 'Name'. Skipping column.
For column HumanResources.Shift.ShiftID. This column is set up as an Identity column, but the SQL Server data type is tinyint. This will be mapped to CLR type byte which does not allow the SqlServerValueGenerationStrategy.IdentityColumn setting. Generating a matching Property but ignoring the Identity setting.
Unable to scaffold the index 'AK_Shift_Name' because one of the properties it contains could not be scaffolded.
Could not find type mapping for column 'Production.ProductCategory.Name' with data type 'Name'. Skipping column.
Unable to scaffold the index 'AK_ProductCategory_Name' because one of the properties it contains could not be scaffolded.
Could not find type mapping for column 'Purchasing.ShipMethod.Name' with data type 'Name'. Skipping column.
Unable to scaffold the index 'AK_ShipMethod_Name' because one of the properties it contains could not be scaffolded.
Could not find type mapping for column 'Production.ProductDocument.DocumentNode' with data type 'hierarchyid'. Skipping column.
Could not scaffold the primary key for 'Production.ProductDocument'. Some columns in the primary key could not be scaffolded.
Unable to generate entity type for table 'Production.ProductDocument'.
Could not find type mapping for column 'dbo.DatabaseLog.DatabaseUser' with data type 'sysname'. Skipping column.
Could not find type mapping for column 'dbo.DatabaseLog.Event' with data type 'sysname'. Skipping column.
Could not find type mapping for column 'dbo.DatabaseLog.Object' with data type 'sysname'. Skipping column.
Could not find type mapping for column 'dbo.DatabaseLog.Schema' with data type 'sysname'. Skipping column.
Could not find type mapping for column 'dbo.DatabaseLog.XmlEvent' with data type 'xml'. Skipping column.
Could not find type mapping for column 'dbo.ErrorLog.UserName' with data type 'sysname'. Skipping column.
Could not find type mapping for column 'Person.Address.SpatialLocation' with data type 'geography'. Skipping column.
Could not find type mapping for column 'Production.ProductModel.Name' with data type 'Name'. Skipping column.
Could not find type mapping for column 'Production.ProductModel.CatalogDescription' with data type 'xml'. Skipping column.
Could not find type mapping for column 'Production.ProductModel.Instructions' with data type 'xml'. Skipping column.
Unable to scaffold the index 'AK_ProductModel_Name' because one of the properties it contains could not be scaffolded.
Unable to scaffold the index 'PXML_ProductModel_CatalogDescription' because one of the properties it contains could not be scaffolded.
Unable to scaffold the index 'PXML_ProductModel_Instructions' because one of the properties it contains could not be scaffolded.
Could not find type mapping for column 'Person.AddressType.Name' with data type 'Name'. Skipping column.
Unable to scaffold the index 'AK_AddressType_Name' because one of the properties it contains could not be scaffolded.
Could not find type mapping for column 'Person.StateProvince.IsOnlyStateProvinceFlag' with data type 'Flag'. Skipping column.
Could not find type mapping for column 'Person.StateProvince.Name' with data type 'Name'. Skipping column.
Unable to scaffold the index 'AK_StateProvince_Name' because one of the properties it contains could not be scaffolded.
For column dbo.AWBuildVersion.SystemInformationID. This column is set up as an Identity column, but the SQL Server data type is tinyint. This will be mapped to CLR type byte which does not allow the SqlServerValueGenerationStrategy.IdentityColumn setting. Generating a matching Property but ignoring the Identity setting.
Could not find type mapping for column 'Sales.Store.Name' with data type 'Name'. Skipping column.
Could not find type mapping for column 'Sales.Store.Demographics' with data type 'xml'. Skipping column.
Unable to scaffold the index 'PXML_Store_Demographics' because one of the properties it contains could not be scaffolded.
Could not find type mapping for column 'Production.ProductProductPhoto.Primary' with data type 'Flag'. Skipping column.
Could not find type mapping for column 'Production.ProductReview.ReviewerName' with data type 'Name'. Skipping column.
Unable to scaffold the index 'IX_ProductReview_ProductID_Name' because one of the properties it contains could not be scaffolded.
Could not find type mapping for column 'Production.ProductSubcategory.Name' with data type 'Name'. Skipping column.
Unable to scaffold the index 'AK_ProductSubcategory_Name' because one of the properties it contains could not be scaffolded.
Could not find type mapping for column 'Production.UnitMeasure.Name' with data type 'Name'. Skipping column.
Unable to scaffold the index 'AK_UnitMeasure_Name' because one of the properties it contains could not be scaffolded.
Could not find type mapping for column 'Purchasing.Vendor.AccountNumber' with data type 'AccountNumber'. Skipping column.
Could not find type mapping for column 'Purchasing.Vendor.ActiveFlag' with data type 'Flag'. Skipping column.
Could not find type mapping for column 'Purchasing.Vendor.PreferredVendorStatus' with data type 'Flag'. Skipping column.
Could not find type mapping for column 'Purchasing.Vendor.Name' with data type 'Name'. Skipping column.
Unable to scaffold the index 'AK_Vendor_AccountNumber' because one of the properties it contains could not be scaffolded.
Could not find type mapping for column 'Person.ContactType.Name' with data type 'Name'. Skipping column.
Unable to scaffold the index 'AK_ContactType_Name' because one of the properties it contains could not be scaffolded.
Could not find type mapping for column 'Person.CountryRegion.Name' with data type 'Name'. Skipping column.
Unable to scaffold the index 'AK_CountryRegion_Name' because one of the properties it contains could not be scaffolded.
Could not find type mapping for column 'Production.Culture.Name' with data type 'Name'. Skipping column.
Unable to scaffold the index 'AK_Culture_Name' because one of the properties it contains could not be scaffolded.
Could not find type mapping for column 'Sales.Currency.Name' with data type 'Name'. Skipping column.
Unable to scaffold the index 'AK_Currency_Name' because one of the properties it contains could not be scaffolded.
Could not find type mapping for column 'HumanResources.Department.GroupName' with data type 'Name'. Skipping column.
Could not find type mapping for column 'HumanResources.Department.Name' with data type 'Name'. Skipping column.
Unable to scaffold the index 'AK_Department_Name' because one of the properties it contains could not be scaffolded.
Could not find type mapping for column 'Production.Document.DocumentNode' with data type 'hierarchyid'. Skipping column.
Could not scaffold the primary key for 'Production.Document'. Some columns in the primary key could not be scaffolded.
Unable to generate entity type for table 'Production.Document'.
Could not find type mapping for column 'HumanResources.Employee.CurrentFlag' with data type 'Flag'. Skipping column.
Could not find type mapping for column 'HumanResources.Employee.SalariedFlag' with data type 'Flag'. Skipping column.
Could not find type mapping for column 'HumanResources.Employee.OrganizationNode' with data type 'hierarchyid'. Skipping column.
Unable to scaffold the index 'IX_Employee_OrganizationLevel_OrganizationNode' because one of the properties it contains could not be scaffolded.
Unable to scaffold the index 'IX_Employee_OrganizationNode' because one of the properties it contains could not be scaffolded.
Could not find type mapping for column 'Sales.SalesOrderHeader.AccountNumber' with data type 'AccountNumber'. Skipping column.
Could not find type mapping for column 'Sales.SalesOrderHeader.OnlineOrderFlag' with data type 'Flag'. Skipping column.
Could not find type mapping for column 'Sales.SalesOrderHeader.PurchaseOrderNumber' with data type 'OrderNumber'. Skipping column.
Could not find type mapping for column 'Production.Illustration.Diagram' with data type 'xml'. Skipping column.
Could not find type mapping for column 'HumanResources.JobCandidate.Resume' with data type 'xml'. Skipping column.
Could not find type mapping for column 'Production.Location.Name' with data type 'Name'. Skipping column.
Unable to scaffold the index 'AK_Location_Name' because one of the properties it contains could not be scaffolded.
Could not find type mapping for column 'Person.Person.FirstName' with data type 'Name'. Skipping column.
Could not find type mapping for column 'Person.Person.LastName' with data type 'Name'. Skipping column.
Could not find type mapping for column 'Person.Person.MiddleName' with data type 'Name'. Skipping column.
Could not find type mapping for column 'Person.Person.NameStyle' with data type 'NameStyle'. Skipping column.
Could not find type mapping for column 'Person.Person.AdditionalContactInfo' with data type 'xml'. Skipping column.
Could not find type mapping for column 'Person.Person.Demographics' with data type 'xml'. Skipping column.
Unable to scaffold the index 'IX_Person_LastName_FirstName_MiddleName' because one of the properties it contains could not be scaffolded.
Unable to scaffold the index 'PXML_Person_AddContact' because one of the properties it contains could not be scaffolded.
Unable to scaffold the index 'PXML_Person_Demographics' because one of the properties it contains could not be scaffolded.
Unable to scaffold the index 'XMLPATH_Person_Demographics' because one of the properties it contains could not be scaffolded.
Unable to scaffold the index 'XMLPROPERTY_Person_Demographics' because one of the properties it contains could not be scaffolded.
Unable to scaffold the index 'XMLVALUE_Person_Demographics' because one of the properties it contains could not be scaffolded.
Could not find type mapping for column 'Sales.SalesReason.Name' with data type 'Name'. Skipping column.
Could not find type mapping for column 'Sales.SalesReason.ReasonType' with data type 'Name'. Skipping column.
Could not find type mapping for column 'Sales.SalesTaxRate.Name' with data type 'Name'. Skipping column.
Could not find type mapping for column 'Person.PersonPhone.PhoneNumber' with data type 'Phone'. Skipping column.
Could not scaffold the primary key for 'Person.PersonPhone'. Some columns in the primary key could not be scaffolded.
Unable to generate entity type for table 'Person.PersonPhone'.
Could not find type mapping for column 'Sales.SalesTerritory.Name' with data type 'Name'. Skipping column.
Unable to scaffold the index 'AK_SalesTerritory_Name' because one of the properties it contains could not be scaffolded.
Could not find type mapping for column 'Person.PhoneNumberType.Name' with data type 'Name'. Skipping column.
Could not find type mapping for column 'Production.Product.FinishedGoodsFlag' with data type 'Flag'. Skipping column.
Could not find type mapping for column 'Production.Product.MakeFlag' with data type 'Flag'. Skipping column.
Could not find type mapping for column 'Production.Product.Name' with data type 'Name'. Skipping column.
Unable to scaffold the index 'AK_Product_Name' because one of the properties it contains could not be scaffolded.
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("ContactType", Schema = "Person")]
public partial class ContactType
{
public ContactType()
{
BusinessEntityContact = new HashSet<BusinessEntityContact>();
}
public int ContactTypeID { get; set; }
public DateTime ModifiedDate { get; set; }
[InverseProperty("ContactType")]
public virtual ICollection<BusinessEntityContact> BusinessEntityContact { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("CountryRegion", Schema = "Person")]
public partial class CountryRegion
{
public CountryRegion()
{
CountryRegionCurrency = new HashSet<CountryRegionCurrency>();
SalesTerritory = new HashSet<SalesTerritory>();
StateProvince = new HashSet<StateProvince>();
}
[MaxLength(3)]
[Key]
public string CountryRegionCode { get; set; }
public DateTime ModifiedDate { get; set; }
[InverseProperty("CountryRegionCodeNavigation")]
public virtual ICollection<CountryRegionCurrency> CountryRegionCurrency { get; set; }
[InverseProperty("CountryRegionCodeNavigation")]
public virtual ICollection<SalesTerritory> SalesTerritory { get; set; }
[InverseProperty("CountryRegionCodeNavigation")]
public virtual ICollection<StateProvince> StateProvince { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("CountryRegionCurrency", Schema = "Sales")]
public partial class CountryRegionCurrency
{
[MaxLength(3)]
public string CountryRegionCode { get; set; }
[MaxLength(3)]
public string CurrencyCode { get; set; }
public DateTime ModifiedDate { get; set; }
[ForeignKey("CountryRegionCode")]
[InverseProperty("CountryRegionCurrency")]
public virtual CountryRegion CountryRegionCodeNavigation { get; set; }
[ForeignKey("CurrencyCode")]
[InverseProperty("CountryRegionCurrency")]
public virtual Currency CurrencyCodeNavigation { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("CreditCard", Schema = "Sales")]
public partial class CreditCard
{
public CreditCard()
{
PersonCreditCard = new HashSet<PersonCreditCard>();
SalesOrderHeader = new HashSet<SalesOrderHeader>();
}
public int CreditCardID { get; set; }
[Required]
[MaxLength(25)]
public string CardNumber { get; set; }
[Required]
[MaxLength(50)]
public string CardType { get; set; }
public byte ExpMonth { get; set; }
public short ExpYear { get; set; }
public DateTime ModifiedDate { get; set; }
[InverseProperty("CreditCard")]
public virtual ICollection<PersonCreditCard> PersonCreditCard { get; set; }
[InverseProperty("CreditCard")]
public virtual ICollection<SalesOrderHeader> SalesOrderHeader { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("Culture", Schema = "Production")]
public partial class Culture
{
public Culture()
{
ProductModelProductDescriptionCulture = new HashSet<ProductModelProductDescriptionCulture>();
}
[MaxLength(6)]
public string CultureID { get; set; }
public DateTime ModifiedDate { get; set; }
[InverseProperty("Culture")]
public virtual ICollection<ProductModelProductDescriptionCulture> ProductModelProductDescriptionCulture { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("Currency", Schema = "Sales")]
public partial class Currency
{
public Currency()
{
CountryRegionCurrency = new HashSet<CountryRegionCurrency>();
CurrencyRate = new HashSet<CurrencyRate>();
CurrencyRateNavigation = new HashSet<CurrencyRate>();
}
[MaxLength(3)]
[Key]
public string CurrencyCode { get; set; }
public DateTime ModifiedDate { get; set; }
[InverseProperty("CurrencyCodeNavigation")]
public virtual ICollection<CountryRegionCurrency> CountryRegionCurrency { get; set; }
[InverseProperty("FromCurrencyCodeNavigation")]
public virtual ICollection<CurrencyRate> CurrencyRate { get; set; }
[InverseProperty("ToCurrencyCodeNavigation")]
public virtual ICollection<CurrencyRate> CurrencyRateNavigation { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("CurrencyRate", Schema = "Sales")]
public partial class CurrencyRate
{
public CurrencyRate()
{
SalesOrderHeader = new HashSet<SalesOrderHeader>();
}
public int CurrencyRateID { get; set; }
public decimal AverageRate { get; set; }
public DateTime CurrencyRateDate { get; set; }
public decimal EndOfDayRate { get; set; }
[Required]
[MaxLength(3)]
public string FromCurrencyCode { get; set; }
public DateTime ModifiedDate { get; set; }
[Required]
[MaxLength(3)]
public string ToCurrencyCode { get; set; }
[InverseProperty("CurrencyRate")]
public virtual ICollection<SalesOrderHeader> SalesOrderHeader { get; set; }
[ForeignKey("FromCurrencyCode")]
[InverseProperty("CurrencyRate")]
public virtual Currency FromCurrencyCodeNavigation { get; set; }
[ForeignKey("ToCurrencyCode")]
[InverseProperty("CurrencyRateNavigation")]
public virtual Currency ToCurrencyCodeNavigation { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("Customer", Schema = "Sales")]
public partial class Customer
{
public Customer()
{
SalesOrderHeader = new HashSet<SalesOrderHeader>();
}
public int CustomerID { get; set; }
[Required]
[MaxLength(10)]
public string AccountNumber { get; set; }
public DateTime ModifiedDate { get; set; }
public int? PersonID { get; set; }
public Guid rowguid { get; set; }
public int? StoreID { get; set; }
public int? TerritoryID { get; set; }
[InverseProperty("Customer")]
public virtual ICollection<SalesOrderHeader> SalesOrderHeader { get; set; }
[ForeignKey("PersonID")]
[InverseProperty("Customer")]
public virtual Person Person { get; set; }
[ForeignKey("StoreID")]
[InverseProperty("Customer")]
public virtual Store Store { get; set; }
[ForeignKey("TerritoryID")]
[InverseProperty("Customer")]
public virtual SalesTerritory Territory { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
public partial class DatabaseLog
{
public int DatabaseLogID { get; set; }
public DateTime PostTime { get; set; }
[Required]
public string TSQL { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("Department", Schema = "HumanResources")]
public partial class Department
{
public Department()
{
EmployeeDepartmentHistory = new HashSet<EmployeeDepartmentHistory>();
}
public short DepartmentID { get; set; }
public DateTime ModifiedDate { get; set; }
[InverseProperty("Department")]
public virtual ICollection<EmployeeDepartmentHistory> EmployeeDepartmentHistory { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("EmailAddress", Schema = "Person")]
public partial class EmailAddress
{
public int BusinessEntityID { get; set; }
public int EmailAddressID { get; set; }
[MaxLength(50)]
public string EmailAddress { get; set; }
public DateTime ModifiedDate { get; set; }
public Guid rowguid { get; set; }
[ForeignKey("BusinessEntityID")]
[InverseProperty("EmailAddress")]
public virtual Person BusinessEntity { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("Employee", Schema = "HumanResources")]
public partial class Employee
{
public Employee()
{
EmployeeDepartmentHistory = new HashSet<EmployeeDepartmentHistory>();
EmployeePayHistory = new HashSet<EmployeePayHistory>();
JobCandidate = new HashSet<JobCandidate>();
PurchaseOrderHeader = new HashSet<PurchaseOrderHeader>();
}
[Key]
public int BusinessEntityID { get; set; }
public DateTime BirthDate { get; set; }
[Required]
[MaxLength(1)]
public string Gender { get; set; }
public DateTime HireDate { get; set; }
[Required]
[MaxLength(50)]
public string JobTitle { get; set; }
[Required]
[MaxLength(256)]
public string LoginID { get; set; }
[Required]
[MaxLength(1)]
public string MaritalStatus { get; set; }
public DateTime ModifiedDate { get; set; }
[Required]
[MaxLength(15)]
public string NationalIDNumber { get; set; }
public short? OrganizationLevel { get; set; }
public Guid rowguid { get; set; }
public short SickLeaveHours { get; set; }
public short VacationHours { get; set; }
[InverseProperty("BusinessEntity")]
public virtual ICollection<EmployeeDepartmentHistory> EmployeeDepartmentHistory { get; set; }
[InverseProperty("BusinessEntity")]
public virtual ICollection<EmployeePayHistory> EmployeePayHistory { get; set; }
[InverseProperty("BusinessEntity")]
public virtual ICollection<JobCandidate> JobCandidate { get; set; }
[InverseProperty("Employee")]
public virtual ICollection<PurchaseOrderHeader> PurchaseOrderHeader { get; set; }
[InverseProperty("BusinessEntity")]
public virtual SalesPerson SalesPerson { get; set; }
[ForeignKey("BusinessEntityID")]
[InverseProperty("Employee")]
public virtual Person BusinessEntity { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("EmployeeDepartmentHistory", Schema = "HumanResources")]
public partial class EmployeeDepartmentHistory
{
public int BusinessEntityID { get; set; }
public DateTime StartDate { get; set; }
public short DepartmentID { get; set; }
public byte ShiftID { get; set; }
public DateTime? EndDate { get; set; }
public DateTime ModifiedDate { get; set; }
[ForeignKey("BusinessEntityID")]
[InverseProperty("EmployeeDepartmentHistory")]
public virtual Employee BusinessEntity { get; set; }
[ForeignKey("DepartmentID")]
[InverseProperty("EmployeeDepartmentHistory")]
public virtual Department Department { get; set; }
[ForeignKey("ShiftID")]
[InverseProperty("EmployeeDepartmentHistory")]
public virtual Shift Shift { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("EmployeePayHistory", Schema = "HumanResources")]
public partial class EmployeePayHistory
{
public int BusinessEntityID { get; set; }
public DateTime RateChangeDate { get; set; }
public DateTime ModifiedDate { get; set; }
public byte PayFrequency { get; set; }
public decimal Rate { get; set; }
[ForeignKey("BusinessEntityID")]
[InverseProperty("EmployeePayHistory")]
public virtual Employee BusinessEntity { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
public partial class ErrorLog
{
public int ErrorLogID { get; set; }
public int? ErrorLine { get; set; }
[Required]
public string ErrorMessage { get; set; }
public int ErrorNumber { get; set; }
[MaxLength(126)]
public string ErrorProcedure { get; set; }
public int? ErrorSeverity { get; set; }
public int? ErrorState { get; set; }
public DateTime ErrorTime { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("Illustration", Schema = "Production")]
public partial class Illustration
{
public Illustration()
{
ProductModelIllustration = new HashSet<ProductModelIllustration>();
}
public int IllustrationID { get; set; }
public DateTime ModifiedDate { get; set; }
[InverseProperty("Illustration")]
public virtual ICollection<ProductModelIllustration> ProductModelIllustration { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("JobCandidate", Schema = "HumanResources")]
public partial class JobCandidate
{
public int JobCandidateID { get; set; }
public int? BusinessEntityID { get; set; }
public DateTime ModifiedDate { get; set; }
[ForeignKey("BusinessEntityID")]
[InverseProperty("JobCandidate")]
public virtual Employee BusinessEntity { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("Location", Schema = "Production")]
public partial class Location
{
public Location()
{
ProductInventory = new HashSet<ProductInventory>();
WorkOrderRouting = new HashSet<WorkOrderRouting>();
}
public short LocationID { get; set; }
public decimal Availability { get; set; }
public decimal CostRate { get; set; }
public DateTime ModifiedDate { get; set; }
[InverseProperty("Location")]
public virtual ICollection<ProductInventory> ProductInventory { get; set; }
[InverseProperty("Location")]
public virtual ICollection<WorkOrderRouting> WorkOrderRouting { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("Password", Schema = "Person")]
public partial class Password
{
[Key]
public int BusinessEntityID { get; set; }
public DateTime ModifiedDate { get; set; }
[Required]
[MaxLength(128)]
public string PasswordHash { get; set; }
[Required]
[MaxLength(10)]
public string PasswordSalt { get; set; }
public Guid rowguid { get; set; }
[ForeignKey("BusinessEntityID")]
[InverseProperty("Password")]
public virtual Person BusinessEntity { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("Person", Schema = "Person")]
public partial class Person
{
public Person()
{
BusinessEntityContact = new HashSet<BusinessEntityContact>();
Customer = new HashSet<Customer>();
EmailAddress = new HashSet<EmailAddress>();
PersonCreditCard = new HashSet<PersonCreditCard>();
}
[Key]
public int BusinessEntityID { get; set; }
public int EmailPromotion { get; set; }
public DateTime ModifiedDate { get; set; }
[Required]
[MaxLength(2)]
public string PersonType { get; set; }
public Guid rowguid { get; set; }
[MaxLength(10)]
public string Suffix { get; set; }
[MaxLength(8)]
public string Title { get; set; }
[InverseProperty("Person")]
public virtual ICollection<BusinessEntityContact> BusinessEntityContact { get; set; }
[InverseProperty("Person")]
public virtual ICollection<Customer> Customer { get; set; }
[InverseProperty("BusinessEntity")]
public virtual ICollection<EmailAddress> EmailAddress { get; set; }
[InverseProperty("BusinessEntity")]
public virtual Employee Employee { get; set; }
[InverseProperty("BusinessEntity")]
public virtual Password Password { get; set; }
[InverseProperty("BusinessEntity")]
public virtual ICollection<PersonCreditCard> PersonCreditCard { get; set; }
[ForeignKey("BusinessEntityID")]
[InverseProperty("Person")]
public virtual BusinessEntity BusinessEntity { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("PersonCreditCard", Schema = "Sales")]
public partial class PersonCreditCard
{
public int BusinessEntityID { get; set; }
public int CreditCardID { get; set; }
public DateTime ModifiedDate { get; set; }
[ForeignKey("BusinessEntityID")]
[InverseProperty("PersonCreditCard")]
public virtual Person BusinessEntity { get; set; }
[ForeignKey("CreditCardID")]
[InverseProperty("PersonCreditCard")]
public virtual CreditCard CreditCard { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("PhoneNumberType", Schema = "Person")]
public partial class PhoneNumberType
{
public int PhoneNumberTypeID { get; set; }
public DateTime ModifiedDate { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("Product", Schema = "Production")]
public partial class Product
{
public Product()
{
BillOfMaterials = new HashSet<BillOfMaterials>();
BillOfMaterialsNavigation = new HashSet<BillOfMaterials>();
ProductCostHistory = new HashSet<ProductCostHistory>();
ProductInventory = new HashSet<ProductInventory>();
ProductListPriceHistory = new HashSet<ProductListPriceHistory>();
ProductProductPhoto = new HashSet<ProductProductPhoto>();
ProductReview = new HashSet<ProductReview>();
ProductVendor = new HashSet<ProductVendor>();
PurchaseOrderDetail = new HashSet<PurchaseOrderDetail>();
ShoppingCartItem = new HashSet<ShoppingCartItem>();
SpecialOfferProduct = new HashSet<SpecialOfferProduct>();
TransactionHistory = new HashSet<TransactionHistory>();
WorkOrder = new HashSet<WorkOrder>();
}
public int ProductID { get; set; }
[MaxLength(2)]
public string Class { get; set; }
[MaxLength(15)]
public string Color { get; set; }
public int DaysToManufacture { get; set; }
public DateTime? DiscontinuedDate { get; set; }
public decimal ListPrice { get; set; }
public DateTime ModifiedDate { get; set; }
[MaxLength(2)]
public string ProductLine { get; set; }
public int? ProductModelID { get; set; }
[Required]
[MaxLength(25)]
public string ProductNumber { get; set; }
public int? ProductSubcategoryID { get; set; }
public short ReorderPoint { get; set; }
public Guid rowguid { get; set; }
public short SafetyStockLevel { get; set; }
public DateTime? SellEndDate { get; set; }
public DateTime SellStartDate { get; set; }
[MaxLength(5)]
public string Size { get; set; }
[MaxLength(3)]
public string SizeUnitMeasureCode { get; set; }
public decimal StandardCost { get; set; }
[MaxLength(2)]
public string Style { get; set; }
public decimal? Weight { get; set; }
[MaxLength(3)]
public string WeightUnitMeasureCode { get; set; }
[InverseProperty("Component")]
public virtual ICollection<BillOfMaterials> BillOfMaterials { get; set; }
[InverseProperty("ProductAssembly")]
public virtual ICollection<BillOfMaterials> BillOfMaterialsNavigation { get; set; }
[InverseProperty("Product")]
public virtual ICollection<ProductCostHistory> ProductCostHistory { get; set; }
[InverseProperty("Product")]
public virtual ICollection<ProductInventory> ProductInventory { get; set; }
[InverseProperty("Product")]
public virtual ICollection<ProductListPriceHistory> ProductListPriceHistory { get; set; }
[InverseProperty("Product")]
public virtual ICollection<ProductProductPhoto> ProductProductPhoto { get; set; }
[InverseProperty("Product")]
public virtual ICollection<ProductReview> ProductReview { get; set; }
[InverseProperty("Product")]
public virtual ICollection<ProductVendor> ProductVendor { get; set; }
[InverseProperty("Product")]
public virtual ICollection<PurchaseOrderDetail> PurchaseOrderDetail { get; set; }
[InverseProperty("Product")]
public virtual ICollection<ShoppingCartItem> ShoppingCartItem { get; set; }
[InverseProperty("Product")]
public virtual ICollection<SpecialOfferProduct> SpecialOfferProduct { get; set; }
[InverseProperty("Product")]
public virtual ICollection<TransactionHistory> TransactionHistory { get; set; }
[InverseProperty("Product")]
public virtual ICollection<WorkOrder> WorkOrder { get; set; }
[ForeignKey("ProductModelID")]
[InverseProperty("Product")]
public virtual ProductModel ProductModel { get; set; }
[ForeignKey("ProductSubcategoryID")]
[InverseProperty("Product")]
public virtual ProductSubcategory ProductSubcategory { get; set; }
[ForeignKey("SizeUnitMeasureCode")]
[InverseProperty("Product")]
public virtual UnitMeasure SizeUnitMeasureCodeNavigation { get; set; }
[ForeignKey("WeightUnitMeasureCode")]
[InverseProperty("ProductNavigation")]
public virtual UnitMeasure WeightUnitMeasureCodeNavigation { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("ProductCategory", Schema = "Production")]
public partial class ProductCategory
{
public ProductCategory()
{
ProductSubcategory = new HashSet<ProductSubcategory>();
}
public int ProductCategoryID { get; set; }
public DateTime ModifiedDate { get; set; }
public Guid rowguid { get; set; }
[InverseProperty("ProductCategory")]
public virtual ICollection<ProductSubcategory> ProductSubcategory { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("ProductCostHistory", Schema = "Production")]
public partial class ProductCostHistory
{
public int ProductID { get; set; }
public DateTime StartDate { get; set; }
public DateTime? EndDate { get; set; }
public DateTime ModifiedDate { get; set; }
public decimal StandardCost { get; set; }
[ForeignKey("ProductID")]
[InverseProperty("ProductCostHistory")]
public virtual Product Product { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("ProductDescription", Schema = "Production")]
public partial class ProductDescription
{
public ProductDescription()
{
ProductModelProductDescriptionCulture = new HashSet<ProductModelProductDescriptionCulture>();
}
public int ProductDescriptionID { get; set; }
[Required]
[MaxLength(400)]
public string Description { get; set; }
public DateTime ModifiedDate { get; set; }
public Guid rowguid { get; set; }
[InverseProperty("ProductDescription")]
public virtual ICollection<ProductModelProductDescriptionCulture> ProductModelProductDescriptionCulture { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("ProductInventory", Schema = "Production")]
public partial class ProductInventory
{
public int ProductID { get; set; }
public short LocationID { get; set; }
public byte Bin { get; set; }
public DateTime ModifiedDate { get; set; }
public short Quantity { get; set; }
public Guid rowguid { get; set; }
[Required]
[MaxLength(10)]
public string Shelf { get; set; }
[ForeignKey("LocationID")]
[InverseProperty("ProductInventory")]
public virtual Location Location { get; set; }
[ForeignKey("ProductID")]
[InverseProperty("ProductInventory")]
public virtual Product Product { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("ProductListPriceHistory", Schema = "Production")]
public partial class ProductListPriceHistory
{
public int ProductID { get; set; }
public DateTime StartDate { get; set; }
public DateTime? EndDate { get; set; }
public decimal ListPrice { get; set; }
public DateTime ModifiedDate { get; set; }
[ForeignKey("ProductID")]
[InverseProperty("ProductListPriceHistory")]
public virtual Product Product { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("ProductModel", Schema = "Production")]
public partial class ProductModel
{
public ProductModel()
{
Product = new HashSet<Product>();
ProductModelIllustration = new HashSet<ProductModelIllustration>();
ProductModelProductDescriptionCulture = new HashSet<ProductModelProductDescriptionCulture>();
}
public int ProductModelID { get; set; }
public DateTime ModifiedDate { get; set; }
public Guid rowguid { get; set; }
[InverseProperty("ProductModel")]
public virtual ICollection<Product> Product { get; set; }
[InverseProperty("ProductModel")]
public virtual ICollection<ProductModelIllustration> ProductModelIllustration { get; set; }
[InverseProperty("ProductModel")]
public virtual ICollection<ProductModelProductDescriptionCulture> ProductModelProductDescriptionCulture { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("ProductModelIllustration", Schema = "Production")]
public partial class ProductModelIllustration
{
public int ProductModelID { get; set; }
public int IllustrationID { get; set; }
public DateTime ModifiedDate { get; set; }
[ForeignKey("IllustrationID")]
[InverseProperty("ProductModelIllustration")]
public virtual Illustration Illustration { get; set; }
[ForeignKey("ProductModelID")]
[InverseProperty("ProductModelIllustration")]
public virtual ProductModel ProductModel { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("ProductModelProductDescriptionCulture", Schema = "Production")]
public partial class ProductModelProductDescriptionCulture
{
public int ProductModelID { get; set; }
public int ProductDescriptionID { get; set; }
[MaxLength(6)]
public string CultureID { get; set; }
public DateTime ModifiedDate { get; set; }
[ForeignKey("CultureID")]
[InverseProperty("ProductModelProductDescriptionCulture")]
public virtual Culture Culture { get; set; }
[ForeignKey("ProductDescriptionID")]
[InverseProperty("ProductModelProductDescriptionCulture")]
public virtual ProductDescription ProductDescription { get; set; }
[ForeignKey("ProductModelID")]
[InverseProperty("ProductModelProductDescriptionCulture")]
public virtual ProductModel ProductModel { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("ProductPhoto", Schema = "Production")]
public partial class ProductPhoto
{
public ProductPhoto()
{
ProductProductPhoto = new HashSet<ProductProductPhoto>();
}
public int ProductPhotoID { get; set; }
public byte[] LargePhoto { get; set; }
[MaxLength(50)]
public string LargePhotoFileName { get; set; }
public DateTime ModifiedDate { get; set; }
public byte[] ThumbNailPhoto { get; set; }
[MaxLength(50)]
public string ThumbnailPhotoFileName { get; set; }
[InverseProperty("ProductPhoto")]
public virtual ICollection<ProductProductPhoto> ProductProductPhoto { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("ProductProductPhoto", Schema = "Production")]
public partial class ProductProductPhoto
{
public int ProductID { get; set; }
public int ProductPhotoID { get; set; }
public DateTime ModifiedDate { get; set; }
[ForeignKey("ProductID")]
[InverseProperty("ProductProductPhoto")]
public virtual Product Product { get; set; }
[ForeignKey("ProductPhotoID")]
[InverseProperty("ProductProductPhoto")]
public virtual ProductPhoto ProductPhoto { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("ProductReview", Schema = "Production")]
public partial class ProductReview
{
public int ProductReviewID { get; set; }
[MaxLength(3850)]
public string Comments { get; set; }
[Required]
[MaxLength(50)]
public string EmailAddress { get; set; }
public DateTime ModifiedDate { get; set; }
public int ProductID { get; set; }
public int Rating { get; set; }
public DateTime ReviewDate { get; set; }
[ForeignKey("ProductID")]
[InverseProperty("ProductReview")]
public virtual Product Product { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("ProductSubcategory", Schema = "Production")]
public partial class ProductSubcategory
{
public ProductSubcategory()
{
Product = new HashSet<Product>();
}
public int ProductSubcategoryID { get; set; }
public DateTime ModifiedDate { get; set; }
public int ProductCategoryID { get; set; }
public Guid rowguid { get; set; }
[InverseProperty("ProductSubcategory")]
public virtual ICollection<Product> Product { get; set; }
[ForeignKey("ProductCategoryID")]
[InverseProperty("ProductSubcategory")]
public virtual ProductCategory ProductCategory { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("ProductVendor", Schema = "Purchasing")]
public partial class ProductVendor
{
public int ProductID { get; set; }
public int BusinessEntityID { get; set; }
public int AverageLeadTime { get; set; }
public decimal? LastReceiptCost { get; set; }
public DateTime? LastReceiptDate { get; set; }
public int MaxOrderQty { get; set; }
public int MinOrderQty { get; set; }
public DateTime ModifiedDate { get; set; }
public int? OnOrderQty { get; set; }
public decimal StandardPrice { get; set; }
[Required]
[MaxLength(3)]
public string UnitMeasureCode { get; set; }
[ForeignKey("BusinessEntityID")]
[InverseProperty("ProductVendor")]
public virtual Vendor BusinessEntity { get; set; }
[ForeignKey("ProductID")]
[InverseProperty("ProductVendor")]
public virtual Product Product { get; set; }
[ForeignKey("UnitMeasureCode")]
[InverseProperty("ProductVendor")]
public virtual UnitMeasure UnitMeasureCodeNavigation { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("PurchaseOrderDetail", Schema = "Purchasing")]
public partial class PurchaseOrderDetail
{
public int PurchaseOrderID { get; set; }
public int PurchaseOrderDetailID { get; set; }
public DateTime DueDate { get; set; }
public decimal LineTotal { get; set; }
public DateTime ModifiedDate { get; set; }
public short OrderQty { get; set; }
public int ProductID { get; set; }
public decimal ReceivedQty { get; set; }
public decimal RejectedQty { get; set; }
public decimal StockedQty { get; set; }
public decimal UnitPrice { get; set; }
[ForeignKey("ProductID")]
[InverseProperty("PurchaseOrderDetail")]
public virtual Product Product { get; set; }
[ForeignKey("PurchaseOrderID")]
[InverseProperty("PurchaseOrderDetail")]
public virtual PurchaseOrderHeader PurchaseOrder { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("PurchaseOrderHeader", Schema = "Purchasing")]
public partial class PurchaseOrderHeader
{
public PurchaseOrderHeader()
{
PurchaseOrderDetail = new HashSet<PurchaseOrderDetail>();
}
[Key]
public int PurchaseOrderID { get; set; }
public int EmployeeID { get; set; }
public decimal Freight { get; set; }
public DateTime ModifiedDate { get; set; }
public DateTime OrderDate { get; set; }
public byte RevisionNumber { get; set; }
public DateTime? ShipDate { get; set; }
public int ShipMethodID { get; set; }
public byte Status { get; set; }
public decimal SubTotal { get; set; }
public decimal TaxAmt { get; set; }
public decimal TotalDue { get; set; }
public int VendorID { get; set; }
[InverseProperty("PurchaseOrder")]
public virtual ICollection<PurchaseOrderDetail> PurchaseOrderDetail { get; set; }
[ForeignKey("EmployeeID")]
[InverseProperty("PurchaseOrderHeader")]
public virtual Employee Employee { get; set; }
[ForeignKey("ShipMethodID")]
[InverseProperty("PurchaseOrderHeader")]
public virtual ShipMethod ShipMethod { get; set; }
[ForeignKey("VendorID")]
[InverseProperty("PurchaseOrderHeader")]
public virtual Vendor Vendor { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("SalesOrderDetail", Schema = "Sales")]
public partial class SalesOrderDetail
{
public int SalesOrderID { get; set; }
public int SalesOrderDetailID { get; set; }
[MaxLength(25)]
public string CarrierTrackingNumber { get; set; }
public decimal LineTotal { get; set; }
public DateTime ModifiedDate { get; set; }
public short OrderQty { get; set; }
public int ProductID { get; set; }
public Guid rowguid { get; set; }
public int SpecialOfferID { get; set; }
public decimal UnitPrice { get; set; }
public decimal UnitPriceDiscount { get; set; }
[ForeignKey("SalesOrderID")]
[InverseProperty("SalesOrderDetail")]
public virtual SalesOrderHeader SalesOrder { get; set; }
[ForeignKey("SpecialOfferID,ProductID")]
[InverseProperty("SalesOrderDetail")]
public virtual SpecialOfferProduct SpecialOfferProduct { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("SalesOrderHeader", Schema = "Sales")]
public partial class SalesOrderHeader
{
public SalesOrderHeader()
{
SalesOrderDetail = new HashSet<SalesOrderDetail>();
SalesOrderHeaderSalesReason = new HashSet<SalesOrderHeaderSalesReason>();
}
[Key]
public int SalesOrderID { get; set; }
public int BillToAddressID { get; set; }
[MaxLength(128)]
public string Comment { get; set; }
[MaxLength(15)]
public string CreditCardApprovalCode { get; set; }
public int? CreditCardID { get; set; }
public int? CurrencyRateID { get; set; }
public int CustomerID { get; set; }
public DateTime DueDate { get; set; }
public decimal Freight { get; set; }
public DateTime ModifiedDate { get; set; }
public DateTime OrderDate { get; set; }
public byte RevisionNumber { get; set; }
public Guid rowguid { get; set; }
[Required]
[MaxLength(25)]
public string SalesOrderNumber { get; set; }
public int? SalesPersonID { get; set; }
public DateTime? ShipDate { get; set; }
public int ShipMethodID { get; set; }
public int ShipToAddressID { get; set; }
public byte Status { get; set; }
public decimal SubTotal { get; set; }
public decimal TaxAmt { get; set; }
public int? TerritoryID { get; set; }
public decimal TotalDue { get; set; }
[InverseProperty("SalesOrder")]
public virtual ICollection<SalesOrderDetail> SalesOrderDetail { get; set; }
[InverseProperty("SalesOrder")]
public virtual ICollection<SalesOrderHeaderSalesReason> SalesOrderHeaderSalesReason { get; set; }
[ForeignKey("BillToAddressID")]
[InverseProperty("SalesOrderHeader")]
public virtual Address BillToAddress { get; set; }
[ForeignKey("CreditCardID")]
[InverseProperty("SalesOrderHeader")]
public virtual CreditCard CreditCard { get; set; }
[ForeignKey("CurrencyRateID")]
[InverseProperty("SalesOrderHeader")]
public virtual CurrencyRate CurrencyRate { get; set; }
[ForeignKey("CustomerID")]
[InverseProperty("SalesOrderHeader")]
public virtual Customer Customer { get; set; }
[ForeignKey("SalesPersonID")]
[InverseProperty("SalesOrderHeader")]
public virtual SalesPerson SalesPerson { get; set; }
[ForeignKey("ShipMethodID")]
[InverseProperty("SalesOrderHeader")]
public virtual ShipMethod ShipMethod { get; set; }
[ForeignKey("ShipToAddressID")]
[InverseProperty("SalesOrderHeaderNavigation")]
public virtual Address ShipToAddress { get; set; }
[ForeignKey("TerritoryID")]
[InverseProperty("SalesOrderHeader")]
public virtual SalesTerritory Territory { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("SalesOrderHeaderSalesReason", Schema = "Sales")]
public partial class SalesOrderHeaderSalesReason
{
public int SalesOrderID { get; set; }
public int SalesReasonID { get; set; }
public DateTime ModifiedDate { get; set; }
[ForeignKey("SalesOrderID")]
[InverseProperty("SalesOrderHeaderSalesReason")]
public virtual SalesOrderHeader SalesOrder { get; set; }
[ForeignKey("SalesReasonID")]
[InverseProperty("SalesOrderHeaderSalesReason")]
public virtual SalesReason SalesReason { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("SalesPerson", Schema = "Sales")]
public partial class SalesPerson
{
public SalesPerson()
{
SalesOrderHeader = new HashSet<SalesOrderHeader>();
SalesPersonQuotaHistory = new HashSet<SalesPersonQuotaHistory>();
SalesTerritoryHistory = new HashSet<SalesTerritoryHistory>();
Store = new HashSet<Store>();
}
[Key]
public int BusinessEntityID { get; set; }
public decimal Bonus { get; set; }
public decimal CommissionPct { get; set; }
public DateTime ModifiedDate { get; set; }
public Guid rowguid { get; set; }
public decimal SalesLastYear { get; set; }
public decimal? SalesQuota { get; set; }
public decimal SalesYTD { get; set; }
public int? TerritoryID { get; set; }
[InverseProperty("SalesPerson")]
public virtual ICollection<SalesOrderHeader> SalesOrderHeader { get; set; }
[InverseProperty("BusinessEntity")]
public virtual ICollection<SalesPersonQuotaHistory> SalesPersonQuotaHistory { get; set; }
[InverseProperty("BusinessEntity")]
public virtual ICollection<SalesTerritoryHistory> SalesTerritoryHistory { get; set; }
[InverseProperty("SalesPerson")]
public virtual ICollection<Store> Store { get; set; }
[ForeignKey("BusinessEntityID")]
[InverseProperty("SalesPerson")]
public virtual Employee BusinessEntity { get; set; }
[ForeignKey("TerritoryID")]
[InverseProperty("SalesPerson")]
public virtual SalesTerritory Territory { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("SalesPersonQuotaHistory", Schema = "Sales")]
public partial class SalesPersonQuotaHistory
{
public int BusinessEntityID { get; set; }
public DateTime QuotaDate { get; set; }
public DateTime ModifiedDate { get; set; }
public Guid rowguid { get; set; }
public decimal SalesQuota { get; set; }
[ForeignKey("BusinessEntityID")]
[InverseProperty("SalesPersonQuotaHistory")]
public virtual SalesPerson BusinessEntity { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("SalesReason", Schema = "Sales")]
public partial class SalesReason
{
public SalesReason()
{
SalesOrderHeaderSalesReason = new HashSet<SalesOrderHeaderSalesReason>();
}
public int SalesReasonID { get; set; }
public DateTime ModifiedDate { get; set; }
[InverseProperty("SalesReason")]
public virtual ICollection<SalesOrderHeaderSalesReason> SalesOrderHeaderSalesReason { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("SalesTaxRate", Schema = "Sales")]
public partial class SalesTaxRate
{
public int SalesTaxRateID { get; set; }
public DateTime ModifiedDate { get; set; }
public Guid rowguid { get; set; }
public int StateProvinceID { get; set; }
public decimal TaxRate { get; set; }
public byte TaxType { get; set; }
[ForeignKey("StateProvinceID")]
[InverseProperty("SalesTaxRate")]
public virtual StateProvince StateProvince { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("SalesTerritory", Schema = "Sales")]
public partial class SalesTerritory
{
public SalesTerritory()
{
Customer = new HashSet<Customer>();
SalesOrderHeader = new HashSet<SalesOrderHeader>();
SalesPerson = new HashSet<SalesPerson>();
SalesTerritoryHistory = new HashSet<SalesTerritoryHistory>();
StateProvince = new HashSet<StateProvince>();
}
[Key]
public int TerritoryID { get; set; }
public decimal CostLastYear { get; set; }
public decimal CostYTD { get; set; }
[Required]
[MaxLength(3)]
public string CountryRegionCode { get; set; }
[Required]
[MaxLength(50)]
public string Group { get; set; }
public DateTime ModifiedDate { get; set; }
public Guid rowguid { get; set; }
public decimal SalesLastYear { get; set; }
public decimal SalesYTD { get; set; }
[InverseProperty("Territory")]
public virtual ICollection<Customer> Customer { get; set; }
[InverseProperty("Territory")]
public virtual ICollection<SalesOrderHeader> SalesOrderHeader { get; set; }
[InverseProperty("Territory")]
public virtual ICollection<SalesPerson> SalesPerson { get; set; }
[InverseProperty("Territory")]
public virtual ICollection<SalesTerritoryHistory> SalesTerritoryHistory { get; set; }
[InverseProperty("Territory")]
public virtual ICollection<StateProvince> StateProvince { get; set; }
[ForeignKey("CountryRegionCode")]
[InverseProperty("SalesTerritory")]
public virtual CountryRegion CountryRegionCodeNavigation { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("SalesTerritoryHistory", Schema = "Sales")]
public partial class SalesTerritoryHistory
{
public int BusinessEntityID { get; set; }
public DateTime StartDate { get; set; }
public int TerritoryID { get; set; }
public DateTime? EndDate { get; set; }
public DateTime ModifiedDate { get; set; }
public Guid rowguid { get; set; }
[ForeignKey("BusinessEntityID")]
[InverseProperty("SalesTerritoryHistory")]
public virtual SalesPerson BusinessEntity { get; set; }
[ForeignKey("TerritoryID")]
[InverseProperty("SalesTerritoryHistory")]
public virtual SalesTerritory Territory { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("ScrapReason", Schema = "Production")]
public partial class ScrapReason
{
public ScrapReason()
{
WorkOrder = new HashSet<WorkOrder>();
}
public short ScrapReasonID { get; set; }
public DateTime ModifiedDate { get; set; }
[InverseProperty("ScrapReason")]
public virtual ICollection<WorkOrder> WorkOrder { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("Shift", Schema = "HumanResources")]
public partial class Shift
{
public Shift()
{
EmployeeDepartmentHistory = new HashSet<EmployeeDepartmentHistory>();
}
public byte ShiftID { get; set; }
public TimeSpan EndTime { get; set; }
public DateTime ModifiedDate { get; set; }
public TimeSpan StartTime { get; set; }
[InverseProperty("Shift")]
public virtual ICollection<EmployeeDepartmentHistory> EmployeeDepartmentHistory { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("ShipMethod", Schema = "Purchasing")]
public partial class ShipMethod
{
public ShipMethod()
{
PurchaseOrderHeader = new HashSet<PurchaseOrderHeader>();
SalesOrderHeader = new HashSet<SalesOrderHeader>();
}
public int ShipMethodID { get; set; }
public DateTime ModifiedDate { get; set; }
public Guid rowguid { get; set; }
public decimal ShipBase { get; set; }
public decimal ShipRate { get; set; }
[InverseProperty("ShipMethod")]
public virtual ICollection<PurchaseOrderHeader> PurchaseOrderHeader { get; set; }
[InverseProperty("ShipMethod")]
public virtual ICollection<SalesOrderHeader> SalesOrderHeader { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("ShoppingCartItem", Schema = "Sales")]
public partial class ShoppingCartItem
{
public int ShoppingCartItemID { get; set; }
public DateTime DateCreated { get; set; }
public DateTime ModifiedDate { get; set; }
public int ProductID { get; set; }
public int Quantity { get; set; }
[Required]
[MaxLength(50)]
public string ShoppingCartID { get; set; }
[ForeignKey("ProductID")]
[InverseProperty("ShoppingCartItem")]
public virtual Product Product { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("SpecialOffer", Schema = "Sales")]
public partial class SpecialOffer
{
public SpecialOffer()
{
SpecialOfferProduct = new HashSet<SpecialOfferProduct>();
}
public int SpecialOfferID { get; set; }
[Required]
[MaxLength(50)]
public string Category { get; set; }
[Required]
[MaxLength(255)]
public string Description { get; set; }
public decimal DiscountPct { get; set; }
public DateTime EndDate { get; set; }
public int? MaxQty { get; set; }
public int MinQty { get; set; }
public DateTime ModifiedDate { get; set; }
public Guid rowguid { get; set; }
public DateTime StartDate { get; set; }
[Required]
[MaxLength(50)]
public string Type { get; set; }
[InverseProperty("SpecialOffer")]
public virtual ICollection<SpecialOfferProduct> SpecialOfferProduct { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("SpecialOfferProduct", Schema = "Sales")]
public partial class SpecialOfferProduct
{
public SpecialOfferProduct()
{
SalesOrderDetail = new HashSet<SalesOrderDetail>();
}
public int SpecialOfferID { get; set; }
public int ProductID { get; set; }
public DateTime ModifiedDate { get; set; }
public Guid rowguid { get; set; }
[InverseProperty("SpecialOfferProduct")]
public virtual ICollection<SalesOrderDetail> SalesOrderDetail { get; set; }
[ForeignKey("ProductID")]
[InverseProperty("SpecialOfferProduct")]
public virtual Product Product { get; set; }
[ForeignKey("SpecialOfferID")]
[InverseProperty("SpecialOfferProduct")]
public virtual SpecialOffer SpecialOffer { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("StateProvince", Schema = "Person")]
public partial class StateProvince
{
public StateProvince()
{
Address = new HashSet<Address>();
SalesTaxRate = new HashSet<SalesTaxRate>();
}
public int StateProvinceID { get; set; }
[Required]
[MaxLength(3)]
public string CountryRegionCode { get; set; }
public DateTime ModifiedDate { get; set; }
public Guid rowguid { get; set; }
[Required]
[MaxLength(3)]
public string StateProvinceCode { get; set; }
public int TerritoryID { get; set; }
[InverseProperty("StateProvince")]
public virtual ICollection<Address> Address { get; set; }
[InverseProperty("StateProvince")]
public virtual ICollection<SalesTaxRate> SalesTaxRate { get; set; }
[ForeignKey("CountryRegionCode")]
[InverseProperty("StateProvince")]
public virtual CountryRegion CountryRegionCodeNavigation { get; set; }
[ForeignKey("TerritoryID")]
[InverseProperty("StateProvince")]
public virtual SalesTerritory Territory { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("Store", Schema = "Sales")]
public partial class Store
{
public Store()
{
Customer = new HashSet<Customer>();
}
[Key]
public int BusinessEntityID { get; set; }
public DateTime ModifiedDate { get; set; }
public Guid rowguid { get; set; }
public int? SalesPersonID { get; set; }
[InverseProperty("Store")]
public virtual ICollection<Customer> Customer { get; set; }
[ForeignKey("BusinessEntityID")]
[InverseProperty("Store")]
public virtual BusinessEntity BusinessEntity { get; set; }
[ForeignKey("SalesPersonID")]
[InverseProperty("Store")]
public virtual SalesPerson SalesPerson { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("TransactionHistory", Schema = "Production")]
public partial class TransactionHistory
{
[Key]
public int TransactionID { get; set; }
public decimal ActualCost { get; set; }
public DateTime ModifiedDate { get; set; }
public int ProductID { get; set; }
public int Quantity { get; set; }
public int ReferenceOrderID { get; set; }
public int ReferenceOrderLineID { get; set; }
public DateTime TransactionDate { get; set; }
[Required]
[MaxLength(1)]
public string TransactionType { get; set; }
[ForeignKey("ProductID")]
[InverseProperty("TransactionHistory")]
public virtual Product Product { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("TransactionHistoryArchive", Schema = "Production")]
public partial class TransactionHistoryArchive
{
[Key]
public int TransactionID { get; set; }
public decimal ActualCost { get; set; }
public DateTime ModifiedDate { get; set; }
public int ProductID { get; set; }
public int Quantity { get; set; }
public int ReferenceOrderID { get; set; }
public int ReferenceOrderLineID { get; set; }
public DateTime TransactionDate { get; set; }
[Required]
[MaxLength(1)]
public string TransactionType { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("UnitMeasure", Schema = "Production")]
public partial class UnitMeasure
{
public UnitMeasure()
{
BillOfMaterials = new HashSet<BillOfMaterials>();
Product = new HashSet<Product>();
ProductNavigation = new HashSet<Product>();
ProductVendor = new HashSet<ProductVendor>();
}
[MaxLength(3)]
[Key]
public string UnitMeasureCode { get; set; }
public DateTime ModifiedDate { get; set; }
[InverseProperty("UnitMeasureCodeNavigation")]
public virtual ICollection<BillOfMaterials> BillOfMaterials { get; set; }
[InverseProperty("SizeUnitMeasureCodeNavigation")]
public virtual ICollection<Product> Product { get; set; }
[InverseProperty("WeightUnitMeasureCodeNavigation")]
public virtual ICollection<Product> ProductNavigation { get; set; }
[InverseProperty("UnitMeasureCodeNavigation")]
public virtual ICollection<ProductVendor> ProductVendor { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("Vendor", Schema = "Purchasing")]
public partial class Vendor
{
public Vendor()
{
ProductVendor = new HashSet<ProductVendor>();
PurchaseOrderHeader = new HashSet<PurchaseOrderHeader>();
}
[Key]
public int BusinessEntityID { get; set; }
public byte CreditRating { get; set; }
public DateTime ModifiedDate { get; set; }
[MaxLength(1024)]
public string PurchasingWebServiceURL { get; set; }
[InverseProperty("BusinessEntity")]
public virtual ICollection<ProductVendor> ProductVendor { get; set; }
[InverseProperty("Vendor")]
public virtual ICollection<PurchaseOrderHeader> PurchaseOrderHeader { get; set; }
[ForeignKey("BusinessEntityID")]
[InverseProperty("Vendor")]
public virtual BusinessEntity BusinessEntity { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("WorkOrder", Schema = "Production")]
public partial class WorkOrder
{
public WorkOrder()
{
WorkOrderRouting = new HashSet<WorkOrderRouting>();
}
public int WorkOrderID { get; set; }
public DateTime DueDate { get; set; }
public DateTime? EndDate { get; set; }
public DateTime ModifiedDate { get; set; }
public int OrderQty { get; set; }
public int ProductID { get; set; }
public short ScrappedQty { get; set; }
public short? ScrapReasonID { get; set; }
public DateTime StartDate { get; set; }
public int StockedQty { get; set; }
[InverseProperty("WorkOrder")]
public virtual ICollection<WorkOrderRouting> WorkOrderRouting { get; set; }
[ForeignKey("ProductID")]
[InverseProperty("WorkOrder")]
public virtual Product Product { get; set; }
[ForeignKey("ScrapReasonID")]
[InverseProperty("WorkOrder")]
public virtual ScrapReason ScrapReason { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
[Table("WorkOrderRouting", Schema = "Production")]
public partial class WorkOrderRouting
{
public int WorkOrderID { get; set; }
public int ProductID { get; set; }
public short OperationSequence { get; set; }
public decimal? ActualCost { get; set; }
public DateTime? ActualEndDate { get; set; }
public decimal? ActualResourceHrs { get; set; }
public DateTime? ActualStartDate { get; set; }
public short LocationID { get; set; }
public DateTime ModifiedDate { get; set; }
public decimal PlannedCost { get; set; }
public DateTime ScheduledEndDate { get; set; }
public DateTime ScheduledStartDate { get; set; }
[ForeignKey("LocationID")]
[InverseProperty("WorkOrderRouting")]
public virtual Location Location { get; set; }
[ForeignKey("WorkOrderID")]
[InverseProperty("WorkOrderRouting")]
public virtual WorkOrder WorkOrder { get; set; }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment