[FSC]Apress Pro Entity Framework 4.0_7

Figure 8-14. Custom Tool removed The good thing is that the EF keeps everything intact. You may at first think that the text template the EF creates is empty. No way. The EF takes everything it uses for code generation and places it in your new text template. Double-click the .tt file to open it in the Visual Studio IDE. If you have line numbers enabled, you see that the file is more than 1,250 lines long. At the top of the file, as shown here, are some nice instructions for modifying the template along with some URLs to provide. | CHAPTER 8 T4 CODE GENERATION Figure 8-14. Custom Tool removed The good thing is that the EF keeps everything intact. You may at first think that the text template the EF creates is empty. No way. The EF takes everything it uses for code generation and places it in your new text template. Double-click the .tt file to open it in the Visual Studio IDE. If you have line numbers enabled you see that the file is more than 1 250 lines long. At the top of the file as shown here are some nice instructions for modifying the template along with some URLs to provide further information. Not too shabby You can use this text template to customize object layer code generation for applications that use the Entity Framework. The template generates code based on an .edmx file. Before using this template note the following The name of the text template file will determine the name of the code file it generates. For example if the text template is named the generated file will be named or . The Custom Tool property of the targeted .edmx file must be empty. For more 141 CHAPTER 8 T4 CODE GENERATION information see .edmx File Properties http fwlink LinkId 139299 . The SourceCsdlPath initialization below must be set to one of the following 1 the path of the targeted .edmx or .csdl file 2 the path of the targeted .edmx or .csdl file relative to the template path For more detailed information about using this template see How to Customize Object Layer Code Generation http fwlink LinkId 139297 . For general information about text templates see Generating Artifacts by Using Text Templates http fwlink LinkId 139298 @ template language C debug false hostspecific true @ include file @ output extension .cs UserSettings userSettings new UserSettings _ . __ SourceCsdlPath @ ReferenceCsdlPaths new string FullyQualifySystemTypes true .

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.