Apress.Blazor.Revealed.Building.Web.Applications.in.NET

所需积分/C币:22 2019-02-18 15:43:51 5.83MB PDF
收藏 收藏
举报

Apress.Blazor.Revealed.Building.Web.Applications.in.NET
Table of contents About the author mmm ix About the technical reviewer ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■口■■■■■■■■■■■■■■■■■■■■■■■口■■■■■■■■■■■■■■■■■■■■■■■ Acknowledgments ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ XII Introduction to WebAssembly and blazon mmmmmXV Chapter 1: Your First Blazor Projectmmar Installing blazon Prerequisites…… NET Core Visual studio 2017 ASP. NET Core blazon Language services 23 ■Ba Visual studio code Installing the Blazor Templates for VS/Code Generating Your Project with Visual Studio 3456 Creating a project with visual studio.ee.. esu. 6 Generating the Project with dotnet climmmannnnnnmnmnnnnmn. 7 Running the project 8 EXamining the Project's Parts.....a 10 The solution The server 10 The shared project 12 The client blazon Project..,.,.,.,,,,,,…,………13 Summary TABLE OF CONTENTS Chapter 2: Data Binding mmmmmmmmmmmmmmmmmmmmmmmmmmmam 19 A Quick Look at razor… 19 0ne- Way Data Binding...,,,,,,,,,,,,,,,,,,,,,…21 One-Way Data Binding Syntax 21 Conditional attributes 22 Event Handling and Data Binding. Event Binding Syntax… 23 Event Arguments 23 Using c Lambda Functions 24 TWo-Way Data Binding. TWo-Way Data Binding Syntax..........................24 Formatting Dates ….26 Reporting Changes The pizza place Single Page Application .. Creating the PizzaPlace Project .mmmmmmm Adding Shared Classes to Represent the Data 30 Building the ul to show the Menu mmmmmmmmmmmmmmmmmmmm. 34 Enter the Customer. m validating the Customer Information 45 Summary.........52 Chapter 3: Components and Structure for Blazor Applications 53 What Is a blazon component? 53 EXamining the Survey Prompt Component...,,,,…………54 Building a Simple alert Component with Razor 5 Separating view and view -Model Building a Component Library. Creating the Component Library Project.........................67 Adding Components to the Library 68 Refering to the Library from Your Project. ....................................................70 TABLE OF CONTENTS Refactoring PizzaPlace into components ..m.mm..mmm. 72 Creating a Component to Display a list of Pizzas ...mmmnnammemnnnmmm 73 Updating the Ul after Changing the State Object Showing the Shopping Basket component 76 Creating a Validation Component library .mmemmnmnmmmnnnnmmmnmnnn 78 Adding the CustomerEntry Component 81 Component Lifecycle Hooks 86 OnInit and OnInitAsync. On Parameters Set and on ParametersSetasync 87 OnAfterRender and OnAfterRenderAsync 87 Disposable,............88 Using Templated Components 89 Creating the Grid Templated component.……………89 Using the grid Templated component..,,,,,,,,,,,,,,,…,………91 Specifying the type Parameter's Type Explicitly 94 Razor templates.amemamamaemamaamaaeaanen 94 The blazon Compilation Mod Summary…, Chapter 4: Services and Dependency Injection mmmmmmmmmmma 101 What Is Dependency Inversion? 101 Understanding Dependency Inversion 102 Using the dependency Inversion Principle 103 Adding Dependency Injection. Applying an Inversion-0f- Control container….........…….106 Configuring dependency Injection..m.m.mmmm..m...mm... 108 Singleton Dependencies…… 110 Transient Dependencies,.........................,...11 Scoped Dependencies Disposing Dependencies 114 TABLE OF CONTENTS Building blazon Services…..,…,115 Adding the Menuservice and lMenuService abstraction mmmmm 116 0 dering Pizzas with a Service...,………,119 Summary… 123 Chapter 5: Data Storage and Microservices maiNT 125 What Understandinghttp 125 Universal resource identifiers and verbs 126 Http Status codes 127 Invoking Server Functionality Using REST 127 Http Headers…127 JavaScript object Notation . Some Examples of rest calls. Building a Simple Microservice Using ASP.NET Core 130 Services and single Responsibility 130 The pizza service…130 What is entity Framework Core? 135 Using the Code First approach mmmmmmammmmmmnmmmammamnmemmmmmamnmmmmnmnn 136 Preparing your project for Code First Migrations. Creating Your First Code First Migration.,,,,,,………144 Generating the Database 146 Enhancing the Pizza microservice .mm Testing Your Microservice Using Postman….,.,,,,,,,,…,…………151 Installing Postman...,,,,,,,,,,,,,,,……………151 Making REst calls with Postman.,,,,,,…,…,……,…………,152 Summary…, 159 Chapter 6: communication with Microservices ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■a■ 161 Using the Httpclient Class....mmmmmmnmnmm.mammmmmnmmmmmammmanmmnon. 161 Examining the server Project 161 Why Use a Shared Project? Looking at the Client Project 164 TABLE OF CONTENTS Understanding the Httpclient class .mnannenmenamnnmnnnnnnannn. 168 The HttpclientjsOnextensions Methods .m...mmmm....mm...mmm....m...nn..... 168 Retrieving Data from the server ,173 Storing Changes.,.,,…,…177 Updating the Database with Orders........................... 178 Building the Order Microservice 183 Talking to the Order microservice. Summary… 186 Chapter 7: Single Page Applications and Routing a187 What Is a Single Page Application..mmnmn.mmmnnn.am..mmm.m..................... 187 Using Layout components 188 blazon layout components 188 Selecting a @layout Component 190 Viewlmports chtml 191 Nested Layouts 192 Understanding routing…,,………194 Installing the router 194 The NavMenu component 195 The Nav Link component...,,…,……………197 Setting the Route Template mamaaneamannmaanmaanemmanmannmmnn 197 Using route Parameters..,.,.,.,.,,,…,……198 Filter URis with route constraints Adding a catchall Route Template ..mmnaemmneennonnnneamnnnnnnnnnnnnn 200 Redirecting to Other Pages 200 Navigating Using an Anchor 200 Navigating Using the Navlink Component……… 200 Navigating with Code 200 Understanding the base Tag m.m...a.amm.m.none.s...a.. 202 Sharing State Between Components………203 Summary… 212 TABLE OF CONTENTS Chapter 8: JavaScript Interoperability mmmasmmmnn 213 Calling JavaScript from C# 213 Providing a glue function 213 Using JSRuntime to Call the Glue Function.mmmmmememnmmmmmnnmm.mo. 214 Storing Data in the Browser with Interop 214 Passing a Reference to JavaScript...,,…,……,217 Calling NET Methods from JavaScri 219 Adding a Glue Function Taking a NET Instance .. Adding a JSInvokable Method to Invoke .. Building a blazon Chart Component Library . Creating the Blazor Component Library. Adding the component library to your project..…..…………224 Adding chart js to the Component Library 226 Adding Chart. js Data and Options Classes nmmammnon.tmmnnnan 230 Registering the JavaScript Glue Function…......,.,,……233 Providing the JavaScript Interoperability Service. Implementing the Line Chart Component..…………236 Using the line chart component.……238 Summary.…240 Index…241 About the author Peter Himschoot works as a lead trainer, architect and strategist at U2U Training Peter has a wide interest in software development, which includes applications for the Web windows, and mobile devices. Peter has trained thousands of developers, is a regular speaker at international conferences, and has been involved in many web and mobile development projects as a software architect. Peter is also a Microsoft Regional Director, a group of trusted advisors to the developer and it professional audiences, and to microsoft About the technical reviewer Gerald versluis is a developer and microsoft MvP from Holland with years of experience working with Xamarin Azure, ASP. NET, and other. NET technologies. He has been involved in numerous projects, in various roles. A great number of his projects are Amarin apps. Not only does gerald like to code, but he is keen on spreading his knowledge as well as gaining some in the bargain. He speaks, provides training sessions, and writes blogs and articles in his spare time

...展开详情
试读 127P Apress.Blazor.Revealed.Building.Web.Applications.in.NET
立即下载 低至0.43元/次 身份认证VIP会员低至7折
    一个资源只可评论一次,评论内容不能少于5个字
    beapkapchy 资料详细,分类正确
    2020-07-22
    回复
    • 签到新秀

      累计签到获取,不积跬步,无以至千里,继续坚持!
    • 分享王者

      成功上传51个资源即可获取
    关注 私信 TA的资源
    上传资源赚积分,得勋章
    最新推荐
    Apress.Blazor.Revealed.Building.Web.Applications.in.NET 22积分/C币 立即下载
    1/127
    Apress.Blazor.Revealed.Building.Web.Applications.in.NET第1页
    Apress.Blazor.Revealed.Building.Web.Applications.in.NET第2页
    Apress.Blazor.Revealed.Building.Web.Applications.in.NET第3页
    Apress.Blazor.Revealed.Building.Web.Applications.in.NET第4页
    Apress.Blazor.Revealed.Building.Web.Applications.in.NET第5页
    Apress.Blazor.Revealed.Building.Web.Applications.in.NET第6页
    Apress.Blazor.Revealed.Building.Web.Applications.in.NET第7页
    Apress.Blazor.Revealed.Building.Web.Applications.in.NET第8页
    Apress.Blazor.Revealed.Building.Web.Applications.in.NET第9页
    Apress.Blazor.Revealed.Building.Web.Applications.in.NET第10页
    Apress.Blazor.Revealed.Building.Web.Applications.in.NET第11页
    Apress.Blazor.Revealed.Building.Web.Applications.in.NET第12页
    Apress.Blazor.Revealed.Building.Web.Applications.in.NET第13页
    Apress.Blazor.Revealed.Building.Web.Applications.in.NET第14页
    Apress.Blazor.Revealed.Building.Web.Applications.in.NET第15页
    Apress.Blazor.Revealed.Building.Web.Applications.in.NET第16页
    Apress.Blazor.Revealed.Building.Web.Applications.in.NET第17页
    Apress.Blazor.Revealed.Building.Web.Applications.in.NET第18页
    Apress.Blazor.Revealed.Building.Web.Applications.in.NET第19页
    Apress.Blazor.Revealed.Building.Web.Applications.in.NET第20页

    试读已结束,剩余107页未读...

    22积分/C币 立即下载 >