Method, 365, 376, 383 Activator.Createinstance()
Total Page:16
File Type:pdf, Size:1020Kb
Index A CreditRisks tables, 854 DBTransaction, 853 Abstract stream members, 765 IDbTransaction interface, 853 Accelerate() method, 365, 376, 383 ProcessCreditRisk(), 855 Activator.CreateInstance() method, 607 Rollback(), 854 Active Data Objects (ADO). see ADO.NET save points, 854 Adaptive rendering, 1396 test, 857 Add() method, 362 data providers AddAsync() method, 1554–1555 application configuration files, 813 AddComplete() method, 705–706 benefit, 802 add_Exploded() method, 377 C# Console Application project, 812 Add() method, 698, 702, 1588 centric namespaces, 806 AddOne() method, 723 core objects, 802 AddPerson(), 401 DBMS, 803 AddWithThreads, 745 factory pattern (see Data provider ADO.NET factory model) AutoLot database creation IDbConnection parameter, 811 adding test records, 818 Microsoft, 804 Customers and Orders tables, 820 Microsoft SQL Server, 813 GetPetName() stored procedure, 819 System.Data.OracleClient.dll, 805 Inventory table creation, 815 third-party, 805 table relationships, in Visual Studio, 822 data readers connected layer of, 801 DbDataReader type, 835 AutoLotDataReader, 830 ExecuteReader(), 835 command objects, 834 multiple result sets, 836 connection objects, 830 Read() method, 835 ConnectionStringBuilder objects, 833 string/int, 835 data reader object, 829 DataSets, 800 Console UI–based front end DataTable, 403 AutoLotCUIClient, 846 disconnected layer, 802 <connectionStrings> element, 847 EF, 802 DeleteCar() method, 850 reusable data access library InsertNewCar() method, 850 AutoLotDAL, 838 ListInventory() method, 849 CloseConnection() method, 838 LookUpPetName(), 851 DbParameter type, 843 Main() method implementation, 847 deletion logic, 840 ShowInstructions() method, 849 insertion logic, 839 statements, 846 InventoryDAL.cs, 838 UpdateCarPetName() method, 851 OpenConnection() method, 838 database transaction, 852 parameterized command APIs, 853 objects, 842 Connection property, 854 selection logic, 841 1603 ■ INDEX ADO.NET (cont.) ListItems, 1495 stored procedure, 844 Lock() method, 1504 update logic, 841 machine.config file, 1520 System.Data namespaces Page_Load event handler, 1509 core members, 807 Profile property, 1522 database primitives, 806 profile data, 1521, 1524 IDataReader and IDataRecord interfaces, 810 Remove() method, 1503 IDbConnection interface, 807 RemoveAll() method, 1503 IDbDataParameter and IDataParameter Session data (see Session data) interfaces, 809 session variable, 1493 IDbTransaction interface, 808 simple web UI, 1492 System.Data.dll, 801 store session data, 1517 Application_Error() method, 1499 aspnet_state.exe, 1517 Application programming interface (API) InstallSqlState.sql, 1518 COM+, 1023 session state server, 1517 DCOM, 1022 web.config file, 1518 MSMQ, 1023 System.Web.Caching.Cache class, 1505 .NET remoting, 1024 System.Web.HttpApplication Type, 1500 web service standards, 1025 Unlock() method, 1504 XML web services, 1025 UserAddress data, 1524 AsDataView<T>() extension method, 927 view state, 1494 AsParallel() extension method, 739 web.config file, 1520 AspNetCarsSite website ASP.NET web forms AdRotator control, 1455 AutoEventWireup attribute, 1430 AutoLotDAL assembly, 1459 client-side scripting, 1395 BuildCar.aspx content page, 1467 code-behind model default content page, 1456 advantages, 1411 filtering, 1465 AutoLotDAL project, 1413 GridView control, 1460 C# code file, 1413 In-Place edition and deletion, 1461 CodeFile attribute, 1412 inventory content page, 1459 debugging and tracing, 1415 master pages, 1449 Default.aspx.cs, 1412 SiteMapPath type, 1455 *.designer.cs file, 1413 sorting and paging, 1464 example, 1412 TreeView control site navigation logic, 1453 GetData method, 1414 ASP.NET state management code files, 1399 addition custom data, 1496 core events, 1428 Application_End() method, 1504 directory structure application/session state distinction, 1501 App_Code folder, 1419 Application_Start() method, 1502 referencing assemblies, 1419 ASPNETDB.mdf file, 1519 subdirectories, 1418 assignment data item, 1503 Error event, 1430 btnGetCar handler, 1492 features, 1398 CacheDependency object, 1507 HTML (see HTML) Cache.NoSlidingExpiration parameter, 1507 HTTP (see HTTP) Context.Cache property, 1505 IIS (see Internet Information Services (IIS)) cookie (see Cookie) life cycle, 1428 DateTime.Now.AddSeconds parameter, 1507 Load event, 1428 Default.aspx page, 1509, 1522 page type EnableViewState, 1495 inheritance chain, 1420 Event Handler, 1499 properties, 1421 GetUserAddress data, 1525 postback to web server, 1397 Global.asax file, 1497 single-file page model HttpApplicationState Type, 1501 application, 1403 lblUserData Label, 1523 *.aspx file, 1402 1604 ■ INDEX AutoLotDAL directory, 1404 GUI, 595 control declarations, 1410 LoadExternalModule() method, 596 data access logic, 1406 VbSnapIn, 593 directives, 1409 Windows Forms application, 593–594 script block, 1410 late binding templates, 1403–1404 CreateUsingLateBinding() method, 576 UI designing, 1406 Invoke Methods, 577 Unload event, 1429 System.Activator class, 574 Web.config file, 1431 TurboBoost() method, 576–577 web controls, 1399 VehicleDescriptionAttributeReader, 587 Web Forms 2.0, 1399 VehicleDescriptionAttribute Web Forms 3.5, 1400 ReaderLateBinding, 588 Web Forms 4.0, 1401 metadata Web Forms 4.5, 1401 Assembly token, 559 Web Forms 4.6, 1402 AssemblyRef #n token, 559 web site vs. web application, 1416 CarLibrary.EngineState enumeration, 556 Assembly-level attribute, 585 get_PetName() method, 558 Asynchronous method invocation ildasm.exe, 556 Add() method, 701 set_PetName() method, 558 AsyncCallback delegate, 703 string literal, 560 AsyncResult Class, 706 TypeRef, 559 AsyncState, 707 .NET attributes BeginInvoke() method, 700 CLS-compliant constructs, 579 EndInvoke() method, 700 constructor parameter, 581 IAsyncResult interface, 700 ildasm.exe, 580 Main() method, 701 notserialized token, 580 thread synchronization, 702 obsolete type, 581–582 Asynchronous programming predefined attributes, 578 AddWithThreads, 745 serializable token, 580 C# async, 741 shorthand attribute, 581 multiple awaits, 744 reflection naming conventions, 743 GetInterfaces() method, 565 void returning, 744 late binding, and custom attributes, 590 Attribute-based programming ListFields() method, 565 custom attribute ListInterfaces() method, 565 AssemblyInfo.cs, 586 Main() method implementation, 566 assembly-level attribute, 585, 587 parameter types, 568 AttributeTargets enumeration, 584 return types, 569 AttributeUsage, 585 System.Collections.Generic.List, 568 class definitions, 583 System.Object.GetType() class, 562 creation, 582 System.Reflection Namespace, 561 module-level attribute, 585 System.Type class, 561–562 named property, 583 System.Type.GetType() operator, 563 dynamic loading Type.GetMethods() method, 564 Assembly class, 569 typeof() operator, 563 Assembly.Load() method, 571–572 Autoincrementing ability, 865 AssemblyName type, 572 AutoLotDAL Version 4 ExternalAssemblyReflector class, 570 AutoLotTestDrive (see AutoLotTestDrive) LINQ, 573 BaseRepo addition extendable application Add() and AddRange() methods, 970 building process, 591 DbSet<T> property, 968 CommonSnappableTypes.dll, 591 Delete()/DeleteAsync() methods, 972 CSharpSnapIn, 592 IDisposable interface, 971 DisplayCompanyData() method, 596 initial class definition, 967 external assemblies, 597 retrieving records, 970 1605 ■ INDEX AutoLotDAL Version 4 (cont.) Binary operators, 405 SaveChanges() helper methods, 968 Binding notification system Save()/SaveAsync() methods, 972 adding bindings and data, 1333 CreditRisk class, 963 observable models CreditRiskRepo, 974 nameof method, 1338 customer model class, 961 PropertyChanged event, 1336 CustomerRepo, 973–974 observable models (see Observable models) data annotations, 957 vehicle data, 1335 DataInitialize, 975 BuildTableRelationship() helper function, 899 DbContext addition, 964 BundleConfig, 1536 DropCreateDatabaseAlways class, 975 DropCreateDatabaseAlways <AutoLotEntities> class, 975 C DropCreateDatabaseIfModelChanges C# access modifiers, 179 <TContext> class, 975 Callback functions, 355 inventory model class, 959 CallMeHere() method, 370 Inventory repository, 973 Cancel() method, 740 IRepo interface addition, 966 CanExecute method, 1368 NuGet packages, 956–957 CanHelpExecute() method, 1179 order model class, 961 CarLotMVC project. see Model-View-Controller OrderRepo, 973 (MVC) pattern Seed() method, 975 C# constructs AutoLot database, 932 arrays AutoLot database, 932 ArrayOfObjects() method, 123 adding test records, 818 creation, 121 Customers and Orders tables, 820 GetStringArray() method, 125 GetPetName() stored procedure, 819 implicitly typed local arrays, 122 Inventory table creation, 815 initialization syntax, 121 table relationships, in Visual Studio, 822 JaggedMultidimensionalArray(), 125 AutoLotTestDrive PrintArray() method, 125 connectionStrings updation, 976 RectMultidimensionalArray(), 125 inventory records Reverse()/Clear() methods, 126 Add() or AddRange() method, 977 SimpleArrays() method, 121 editing, 978 System.Array class, 126 printing, 977 System.Object.GetType() method, 123 Main() method, 977 enum type MakeCustomerARisk() method, 980 definition, 128 navigation properties enumeration value, 131 eager loading, 980 Enum.GetUnderlyingType() method, 131 output window, 979 magic numbers, 129 ShowAllOrders() method, 979 name-value pair, 132 PrintAllCustomersAndCreditRisks() storage value, 129 method, 981 System.Enum type, 130 underlying type, 129 variable declaration, 129 B methods, parameter modifiers, 109 BasicStringFunctionality()