public static List<Model> ListModels( int manufacturerId, bool isCarModel, bool showAll, IEnumerable<int> countriesIds ) { using( var ctx = new TecdocBaseDataContext() ) { ctx.DeferredLoadingEnabled = false; DataLoadOptions dlo = new DataLoadOptions(); dlo.LoadWith<Model>( m => m.Name ); ctx.LoadOptions = dlo; return ctx.ListModels( manufacturerId, isCarModel, showAll, countriesIds ); } }
public void ListModelsTest() { using( var ctx = new TecdocBaseDataContext() ) { var mfr = GetManufacturer( null ); var arr1 = ctx.ListModels(mfr.ID, true, true, new int[] { 185, 246 }); var arr2 = ctx.ListModels(mfr.ID, true, false, new int[] { 185, 246 }); Assert.IsTrue( arr1.Count >= arr2.Count ); var curModels = ctx.ListModels( mfr.ID ); } }
public static List<Model> ListModels( int manufacturerID ) { using( var ctx = new RmsAuto.TechDoc.Entities.TecdocBase.TecdocBaseDataContext() ) { var dlo = new DataLoadOptions(); dlo.LoadWith<Model>( m => m.Name ); ctx.LoadOptions = dlo; return ctx.ListModels( manufacturerID ); } }