The document describes how to build a Movie List application using ASP.NET MVC and Entity Framework Core by explaining how to set up the model classes, controllers, views, and database context to display, add, edit and delete movie data, relating movies to genres and making the URLs more user-friendly. It provides code examples for each part of the application.
Murach: An introduction to web programming with ASP.NET Core MVCMahmoudOHassouna
Murach: An introduction to web programming with ASP.NET Core MVC
Mary Delamater, Joel Murach - Murach's ASP.NET Core MVC-Mike Murach & Associates, Inc. (2020) (1)
Murach: How to validate data in asp.net core mvcMahmoudOHassouna
- You can validate user-input data in ASP.NET MVC using data attributes on model properties and custom validation attributes. Data attributes like Required, Range, StringLength allow property-level validation, while custom attributes can perform cross-field and custom validation logic.
- Client-side validation is enabled by default and prevents invalid submissions, but server-side validation in the controller is also needed as the only authorization. You can customize validation error messages and UI.
Murach: An introduction to web programming with ASP.NET Core MVCMahmoudOHassouna
Murach: An introduction to web programming with ASP.NET Core MVC
Mary Delamater, Joel Murach - Murach's ASP.NET Core MVC-Mike Murach & Associates, Inc. (2020) (1)
Murach: How to validate data in asp.net core mvcMahmoudOHassouna
- You can validate user-input data in ASP.NET MVC using data attributes on model properties and custom validation attributes. Data attributes like Required, Range, StringLength allow property-level validation, while custom attributes can perform cross-field and custom validation logic.
- Client-side validation is enabled by default and prevents invalid submissions, but server-side validation in the controller is also needed as the only authorization. You can customize validation error messages and UI.
This paper’s aim is to point out the RAD ( Rapid application development) elements present in the Microsoft’s MVC 3 and WCF 4.0 using Microsoft Visual Studio 2010. It will describe why creating a new web application using MVC 3 and WCF 4.0 is a easy and fast and also present simple ways to develop such applications.
This document provides an introduction to programming languages and variables. It explains that a programming language acts as a translator between a programmer's instructions and the computer's machine language. It also defines what variables are in programming - namely, that they are names that store and represent values like numbers, text, or true/false states. The document gives examples of how to declare variables in Visual Basic by specifying their name, data type, and assigning an initial value. It also shows how to display a variable's value using a message box.
This document provides release notes for Oracle9i Reports Developer Release 2 (9.0.2) from April 2002. It describes general issues, configuration issues, UI issues, and workarounds. Key points include deprecated features from earlier versions, issues with pluggable data sources, configuration of the Reports_CLASSPATH variable, and enabling source control in the Windows UI. The document provides technical details and troubleshooting guidance for using Oracle9i Reports Developer.
SQLite is an embedded SQL database that contains a C library. It is not a client-server database and instead embeds directly into the end program. SQLite follows PostgreSQL syntax. To connect with SQLite from Python, you import the sqlite3 module and use the connect() method to create a Connection object. From there you can create a Cursor object to execute SQL statements like CREATE TABLE, INSERT, SELECT, WHERE, ORDER BY, UPDATE, and DELETE.
ASP.Net is a web development platform that provides a programming model, infrastructure, and services for building robust web applications. It uses HTTP to enable two-way communication between a browser and server. ASP.Net applications are compiled code written in languages like C# and VB.Net that can use classes in the .Net framework. The ASP.Net lifecycle involves initializing and loading pages, handling events, rendering output, and unloading pages. Key stages include initialization, loading, validation, handling postback events, and rendering.
The document describes the features and interface of the Programming Without Coding Technology (PWCT) environment. The PWCT environment allows visual programming through a graphical interface and contains various windows and tools for visual programming, including a server units window to manage server code, a goal designer to create goals to override code, and designers for interactions and transporters. It provides features like visual programming languages, framework extensions, and supports multiple operating systems.
This document describes how to connect to a database and run commands like UPDATE, INSERT, or DELETE using ADO.NET in a Visual Basic .NET console application. It explains how to create a connection string, open a connection, construct a command object specifying the SQL statement, and execute the command. Parameters can be used in the SQL statement and values bound to the parameters when executing the command.
This document discusses BI Publisher, an Oracle product for template-based report generation. It provides an overview of BI Publisher, describing what it is, its advantages, and how it separates data extraction from report layout. It also discusses the key classes used in the BI Publisher API - Report Definition, Report Manager, and Engine - and provides examples of how to generate and publish a report using these classes.
The document provides instructions for migrating user and group security between Salesforce organizations using the Force.com Migration Tool. It describes how to set up the tool, including installing required software, configuring connection settings, constructing a project manifest file to specify metadata to migrate, retrieving metadata from the source org, and deploying it to the target org. The tool uses Ant tasks to automate migrating metadata and security configurations between orgs.
The document provides guidance on getting started with Apex code in Salesforce, including:
- How to add an Apex class and write triggers to automate processes like increasing fees.
- Context variables available in triggers to access field values.
- Tips for using the developer console to write, save and test Apex code and triggers.
- Examples of creating a custom object and Apex code to increase fees on that object by 2%.
This document provides a tutorial on using the Simple Object Access Protocol (SOAP) for communication between components via XML messaging. It introduces an example calendar widget component that can receive event updates and return an HTML-formatted display of events. The tutorial demonstrates making a SOAP request to add a listing to the calendar by specifying the request in an XML envelope and body according to SOAP conventions. It also shows the empty response confirming the listing was added.
Create an android app for database creation using.pptxvishal choudhary
1) This document describes how to create an Android app to perform CRUD (create, read, update, delete) operations on a SQLite database.
2) It involves creating a SQLiteOpenHelper subclass to manage the database, along with methods to insert, query, update and delete data from the database table.
3) The Android app includes layout elements like buttons and text fields, and Java code to handle button clicks and call the appropriate database methods. Validation is also added to ensure required fields are populated.
This document summarizes a presentation on building VSTO applications using LINQ. The presentation covers the fundamentals of VSTO development, how and why to use LINQ, and includes demos. Reasons for using VSTO over VBA are discussed, as well as how to add LINQ to a VSTO application.
This document discusses using Excel for reporting purposes by connecting it to a database using ActiveX Data Objects (ADO). It provides an overview of ADO basics like using connection and recordset objects to retrieve and manipulate data. The document then covers building reports programmatically in Excel/VBA by inserting row/column headers from database tables, retrieving data blocks using SQL queries, and applying formatting/styles. The goal is to automate report generation while storing transactional data in a proper database for audit trails, security, and referential integrity.
The document describes how to use Mulesoft to connect a CSV file to a Salesforce account. It involves using a File connector to monitor an input folder for CSV files. A Salesforce connector is configured with a username, password and security token. A DataMapper transformer maps the CSV file fields to Salesforce object fields. When run, the application will take CSV contact data from the input folder and upload it to the Salesforce account as new contacts.
Generate Excel documents with Rational Publishing Engine 1.1.2 and Reporting ...GEBS Reporting
Integrating IBM Rational Publishing Engine 1.1.2 with Reporting Arena Excel Converter to generate documents from various IBM Rational tools in MS Excel format.
The document provides instructions on using the Force.com Migration Tool to migrate metadata between a local directory and a Salesforce organization. It discusses installing the tool, setting up the build files with connection information and targets, constructing a project manifest, retrieving metadata from an org, and deploying it to another org. The tool allows automating repetitive deployment tasks through its use of Ant scripts.
This document discusses moving existing websites with security issues to the ASP.NET MVC framework using Entity Framework. It provides an overview of MVC and EF, how to set them up in Visual Studio, and examples of using them to improve security by removing direct SQL queries and moving more logic to the server. Key benefits highlighted include built-in features for validation and preventing cross-site request forgery attacks. Examples demonstrate querying databases and validating models without writing direct SQL or adding additional code.
Metamorphosis from Forms to Java: A technical lead's perspective, part IIMichael Fons
This document provides an overview of key concepts for transitioning from Forms development to Java and ADF, including deployment, the MVC pattern, beans, GUI components, collections vs iterators, and tips. It includes 11 demo sections walking through creating a basic model and UI, visual designer, bindings, passing data between pages, authorization, and extending the framework. The summaries aim to highlight the main topics covered in each section at a high level.
Learning MVC Part 3 Creating MVC Application with EntityFrameworkAkhil Mittal
This document discusses connecting an existing MVC application to a database using Entity Framework instead of LINQ to SQL. It provides steps to generate an Entity Data Model from an existing database, generate strongly typed entity classes, and modify the application's controllers to use the Entity Framework context instead of the LINQ to SQL context. The key steps are: 1) Adding an Entity Data Model file and generating entity classes; 2) Modifying controllers to use the Entity Framework context instead of LINQ to SQL; 3) Binding views to the generated entity classes. The document emphasizes that Entity Framework automates CRUD operations and allows focusing on business logic rather than data access code.
Resolve dependency of dependencies using Inversion of Control and dependency ...Akhil Mittal
In my last two articles I explained how to create a RESTful service using ASP.NET Web API working with Entity Framework and resolving dependencies using Unity Container. In this article I’ll explain how to create a loosely coupled system with Unity Container and MEF(Managed Extensibility Framework) using Inversion of Control. I’ll not be explaining much theory but rather focus more on practical implementations. For the readers who are following this series, they can use their existing solution that they have created till time. For my new readers of this article, I have provided the download link for the previous source code and current source code as well.
For theory and understanding of DI and IOC you can follow the following links: Unity and Inversion of Control(IOC).
MCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISPAli Shah
Exception handling in C# uses four keywords: try, catch, finally, and throw. The try block identifies code that might cause exceptions. The catch block handles exceptions, while finally ensures code is always executed. Exceptions are represented by classes derived from System.Exception, and common exceptions include NullReferenceException and DivideByZeroException. ADO.NET provides objects like SqlConnection and SqlCommand to connect C# applications to SQL Server databases using connection strings. Data can be queried, inserted, and read from databases through these objects.
This paper’s aim is to point out the RAD ( Rapid application development) elements present in the Microsoft’s MVC 3 and WCF 4.0 using Microsoft Visual Studio 2010. It will describe why creating a new web application using MVC 3 and WCF 4.0 is a easy and fast and also present simple ways to develop such applications.
This document provides an introduction to programming languages and variables. It explains that a programming language acts as a translator between a programmer's instructions and the computer's machine language. It also defines what variables are in programming - namely, that they are names that store and represent values like numbers, text, or true/false states. The document gives examples of how to declare variables in Visual Basic by specifying their name, data type, and assigning an initial value. It also shows how to display a variable's value using a message box.
This document provides release notes for Oracle9i Reports Developer Release 2 (9.0.2) from April 2002. It describes general issues, configuration issues, UI issues, and workarounds. Key points include deprecated features from earlier versions, issues with pluggable data sources, configuration of the Reports_CLASSPATH variable, and enabling source control in the Windows UI. The document provides technical details and troubleshooting guidance for using Oracle9i Reports Developer.
SQLite is an embedded SQL database that contains a C library. It is not a client-server database and instead embeds directly into the end program. SQLite follows PostgreSQL syntax. To connect with SQLite from Python, you import the sqlite3 module and use the connect() method to create a Connection object. From there you can create a Cursor object to execute SQL statements like CREATE TABLE, INSERT, SELECT, WHERE, ORDER BY, UPDATE, and DELETE.
ASP.Net is a web development platform that provides a programming model, infrastructure, and services for building robust web applications. It uses HTTP to enable two-way communication between a browser and server. ASP.Net applications are compiled code written in languages like C# and VB.Net that can use classes in the .Net framework. The ASP.Net lifecycle involves initializing and loading pages, handling events, rendering output, and unloading pages. Key stages include initialization, loading, validation, handling postback events, and rendering.
The document describes the features and interface of the Programming Without Coding Technology (PWCT) environment. The PWCT environment allows visual programming through a graphical interface and contains various windows and tools for visual programming, including a server units window to manage server code, a goal designer to create goals to override code, and designers for interactions and transporters. It provides features like visual programming languages, framework extensions, and supports multiple operating systems.
This document describes how to connect to a database and run commands like UPDATE, INSERT, or DELETE using ADO.NET in a Visual Basic .NET console application. It explains how to create a connection string, open a connection, construct a command object specifying the SQL statement, and execute the command. Parameters can be used in the SQL statement and values bound to the parameters when executing the command.
This document discusses BI Publisher, an Oracle product for template-based report generation. It provides an overview of BI Publisher, describing what it is, its advantages, and how it separates data extraction from report layout. It also discusses the key classes used in the BI Publisher API - Report Definition, Report Manager, and Engine - and provides examples of how to generate and publish a report using these classes.
The document provides instructions for migrating user and group security between Salesforce organizations using the Force.com Migration Tool. It describes how to set up the tool, including installing required software, configuring connection settings, constructing a project manifest file to specify metadata to migrate, retrieving metadata from the source org, and deploying it to the target org. The tool uses Ant tasks to automate migrating metadata and security configurations between orgs.
The document provides guidance on getting started with Apex code in Salesforce, including:
- How to add an Apex class and write triggers to automate processes like increasing fees.
- Context variables available in triggers to access field values.
- Tips for using the developer console to write, save and test Apex code and triggers.
- Examples of creating a custom object and Apex code to increase fees on that object by 2%.
This document provides a tutorial on using the Simple Object Access Protocol (SOAP) for communication between components via XML messaging. It introduces an example calendar widget component that can receive event updates and return an HTML-formatted display of events. The tutorial demonstrates making a SOAP request to add a listing to the calendar by specifying the request in an XML envelope and body according to SOAP conventions. It also shows the empty response confirming the listing was added.
Create an android app for database creation using.pptxvishal choudhary
1) This document describes how to create an Android app to perform CRUD (create, read, update, delete) operations on a SQLite database.
2) It involves creating a SQLiteOpenHelper subclass to manage the database, along with methods to insert, query, update and delete data from the database table.
3) The Android app includes layout elements like buttons and text fields, and Java code to handle button clicks and call the appropriate database methods. Validation is also added to ensure required fields are populated.
This document summarizes a presentation on building VSTO applications using LINQ. The presentation covers the fundamentals of VSTO development, how and why to use LINQ, and includes demos. Reasons for using VSTO over VBA are discussed, as well as how to add LINQ to a VSTO application.
This document discusses using Excel for reporting purposes by connecting it to a database using ActiveX Data Objects (ADO). It provides an overview of ADO basics like using connection and recordset objects to retrieve and manipulate data. The document then covers building reports programmatically in Excel/VBA by inserting row/column headers from database tables, retrieving data blocks using SQL queries, and applying formatting/styles. The goal is to automate report generation while storing transactional data in a proper database for audit trails, security, and referential integrity.
The document describes how to use Mulesoft to connect a CSV file to a Salesforce account. It involves using a File connector to monitor an input folder for CSV files. A Salesforce connector is configured with a username, password and security token. A DataMapper transformer maps the CSV file fields to Salesforce object fields. When run, the application will take CSV contact data from the input folder and upload it to the Salesforce account as new contacts.
Generate Excel documents with Rational Publishing Engine 1.1.2 and Reporting ...GEBS Reporting
Integrating IBM Rational Publishing Engine 1.1.2 with Reporting Arena Excel Converter to generate documents from various IBM Rational tools in MS Excel format.
The document provides instructions on using the Force.com Migration Tool to migrate metadata between a local directory and a Salesforce organization. It discusses installing the tool, setting up the build files with connection information and targets, constructing a project manifest, retrieving metadata from an org, and deploying it to another org. The tool allows automating repetitive deployment tasks through its use of Ant scripts.
This document discusses moving existing websites with security issues to the ASP.NET MVC framework using Entity Framework. It provides an overview of MVC and EF, how to set them up in Visual Studio, and examples of using them to improve security by removing direct SQL queries and moving more logic to the server. Key benefits highlighted include built-in features for validation and preventing cross-site request forgery attacks. Examples demonstrate querying databases and validating models without writing direct SQL or adding additional code.
Metamorphosis from Forms to Java: A technical lead's perspective, part IIMichael Fons
This document provides an overview of key concepts for transitioning from Forms development to Java and ADF, including deployment, the MVC pattern, beans, GUI components, collections vs iterators, and tips. It includes 11 demo sections walking through creating a basic model and UI, visual designer, bindings, passing data between pages, authorization, and extending the framework. The summaries aim to highlight the main topics covered in each section at a high level.
Learning MVC Part 3 Creating MVC Application with EntityFrameworkAkhil Mittal
This document discusses connecting an existing MVC application to a database using Entity Framework instead of LINQ to SQL. It provides steps to generate an Entity Data Model from an existing database, generate strongly typed entity classes, and modify the application's controllers to use the Entity Framework context instead of the LINQ to SQL context. The key steps are: 1) Adding an Entity Data Model file and generating entity classes; 2) Modifying controllers to use the Entity Framework context instead of LINQ to SQL; 3) Binding views to the generated entity classes. The document emphasizes that Entity Framework automates CRUD operations and allows focusing on business logic rather than data access code.
Resolve dependency of dependencies using Inversion of Control and dependency ...Akhil Mittal
In my last two articles I explained how to create a RESTful service using ASP.NET Web API working with Entity Framework and resolving dependencies using Unity Container. In this article I’ll explain how to create a loosely coupled system with Unity Container and MEF(Managed Extensibility Framework) using Inversion of Control. I’ll not be explaining much theory but rather focus more on practical implementations. For the readers who are following this series, they can use their existing solution that they have created till time. For my new readers of this article, I have provided the download link for the previous source code and current source code as well.
For theory and understanding of DI and IOC you can follow the following links: Unity and Inversion of Control(IOC).
MCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISPAli Shah
Exception handling in C# uses four keywords: try, catch, finally, and throw. The try block identifies code that might cause exceptions. The catch block handles exceptions, while finally ensures code is always executed. Exceptions are represented by classes derived from System.Exception, and common exceptions include NullReferenceException and DivideByZeroException. ADO.NET provides objects like SqlConnection and SqlCommand to connect C# applications to SQL Server databases using connection strings. Data can be queried, inserted, and read from databases through these objects.
CyberLab Training Division :
ASP.NET is a web application framework developed and marketed by Microsoft to allow programmers to build dynamic web sites. It allows you to use a full featured programming language such as C# or VB.NET to build web applications easily.
This tutorial covers all the basic elements of ASP.NET that a beginner would require to get started.
Audience
This tutorial has been prepared for the beginners to help them understand basic ASP.NET programming. After completing this tutorial you will find yourself at a moderate level of expertise in ASP.NET programming from where you can take yourself to next levels.
Prerequisites
Before proceeding with this tutorial, you should have a basic understanding of .NET programming language. As we are going to develop web-based applications using ASP.NET web application framework, it will be good if you have an understanding of other web technologies such as HTML, CSS, AJAX. etc
ASP.NET supports three different development models:
Web Pages, MVC (Model View Controller), and Web Forms.
For More Details.
Visit: http://www.cyberlabzone.com
ASP.NET is a web development platform provided by Microsoft that is used for creating web-based applications. It allows applications to be written in languages like C#, VB.Net, and J#. ASP.NET uses a request-response model where requests are handled by the web server which returns responses to the client. It has a set of standard class libraries, the most used being the Web library which contains components for developing web applications. ASP.NET applications go through a page lifecycle on each request, initializing objects and allowing events to be handled at each stage before a response is returned.
The document discusses Visual Basic .NET and the .NET framework. It describes how the .NET framework defines the environment for executing VB.NET applications and services that can be used within applications. It also discusses how Visual Studio includes components like the Microsoft Development Environment and Microsoft SQL Server 2000 Desktop Engine that make it an outstanding development product. Finally, it explains that Visual Studio .NET is a suite of products that includes programming languages like Visual Basic, C#, and C++ for developing applications.
This document provides an overview of implementing a 3-tier architecture in ASP.NET using C#. It describes the 3 tiers - presentation layer, business logic layer, and data access layer. The presentation layer handles user input/output. The business logic layer contains application logic and communicates with the data access layer. The data access layer connects to the database and performs CRUD operations. The document outlines setting up the project structure with App_Code/BusinessLayer and App_Code/DataAccessLayer folders and creating sample BusinessLogic and DataAccess classes.
The document provides instructions on how to create device channels and apply master pages to those channels in SharePoint 2013. It explains that device channels allow different master pages to be used for different devices. It then gives step-by-step directions on how to create a mobile device channel and apply a mobile master page to that channel using both the user interface and PowerShell. It also discusses how to create and export design packages to apply custom branding across sites.
This document provides an overview of ASP.NET MVC frameworks and how to get started with ASP.NET MVC 4. It discusses how ASP.NET MVC supports the MVC pattern and test-driven development. It also describes how to install ASP.NET MVC 4, create a basic MVC 4 project with different templates, add controllers and views, and connect to a database using Entity Framework.
HP ArcSight Asset Model Import FlexConnector Developer's GuideProtect724tk
The document provides information about installing and configuring the HP ArcSight Asset Model Import FlexConnector, which allows importing asset model data from a CSV file into the ArcSight ESM network model. It describes prerequisites, installing the FlexConnector, configuring it to point to the CSV files and associated parsers, and running the connector. It also provides a template for the required parser files to match the CSV file format.
This document provides instructions for building an InfoCube using only the Business Warehouse Accelerator (BWA) to improve query performance. It advises running a data transfer process (DTP) frequently from the DataStore Object (DSO) to the BWA-only InfoCube after each new data load to keep the cube as up-to-date as possible in memory for fast queries. Regular DSO loads require an automated process chain to trigger the DTP, and the DTP should run after every DSO request to ensure the cube reflects the latest DSO data.
The document provides an overview of ADO.NET and its core classes:
- ADO.NET uses datasets to store data from a database in memory and data provider objects like connections, commands, and data adapters to retrieve and update data in the database.
- The .NET Framework includes the SQL Server and OLE DB data providers, which provide classes like SqlConnection and OleDbConnection to connect to databases.
- Core classes like SqlCommand represent SQL statements, and SqlDataAdapter links commands and connections to datasets to load and save data.
Repository Pattern in MVC3 Application with Entity FrameworkAkhil Mittal
The document discusses implementing a repository pattern in an MVC application using Entity Framework. It begins with an introduction and roadmap of previous articles. It then discusses the benefits of a repository pattern in abstracting the data access layer from business logic. Steps are provided to create a sample repository interface and class to implement basic CRUD operations on a User entity, abstracting the data access code from the controller. The repository class uses the Entity Framework context to perform operations while resolving tight coupling issues between layers. It concludes that while this implementation works for a single entity, a generic repository will be needed to cleanly support multiple entities without duplication.
These projects demonstrated my ability to program Visual Studio .Net with C# as the programming language in 2 separate projects.
The Purpose of the first project was to build parts of the business tier for a retail Company. The goal is to create and test two assemblies. The first assembly is a class library project called Foundation. It will contain various interfaces and base classes.
The second assembly is also a Class Library project and its called AppTypes and it will contain various entity, collection and exception classes used by various business processes.
The Objective of the second project Is to create a database to support the principal functions of a library’s day-to-day operations: adding new members (adult and juvenile) and checking books in and out.
A Windows Forms-based front end application that will provide a librarian with a visual interface through which he or she may perform the desired functions.
And the project goal is to Design and develop a front end application that satisfies the four basic functionalities: Add Adult, Add Juvenile, Check in a book, Check Out a book.
Develop code that is easily maintainable.
Provide validation for all required fields.
Provide adequate error handling.
Produce a user interface that is intuitive, requiring minimal training for users while minimizing resource utilization.
The document describes creating components and component processes in UrbanCode Deploy. It includes the following steps:
1. Create three components for the JPetStore application - one each for the app, database, and web files. Import versions of each from the file system.
2. Create a deployment process for the web component that includes steps to clean the working directory and download the latest version of the web component artifacts.
3. Similar processes will be created for the other components and then an application process will call the component processes to deploy the full application.
The document provides an overview of Entity Framework and Code First approach. It discusses the key features of Entity Framework including object-relational mapping, support for various databases, and using LINQ queries. It also covers the advantages of Entity Framework like productivity, maintainability and performance. Furthermore, it explains the different domain modeling approaches in Entity Framework - Model First, Database First and Code First along with code examples.
Similar a Murach': HOW TO DEVELOP A DATA DRIVEN MVC WEB (20)
This presentation was provided by Racquel Jemison, Ph.D., Christina MacLaughlin, Ph.D., and Paulomi Majumder. Ph.D., all of the American Chemical Society, for the second session of NISO's 2024 Training Series "DEIA in the Scholarly Landscape." Session Two: 'Expanding Pathways to Publishing Careers,' was held June 13, 2024.
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptxEduSkills OECD
Iván Bornacelly, Policy Analyst at the OECD Centre for Skills, OECD, presents at the webinar 'Tackling job market gaps with a skills-first approach' on 12 June 2024
Gender and Mental Health - Counselling and Family Therapy Applications and In...PsychoTech Services
A proprietary approach developed by bringing together the best of learning theories from Psychology, design principles from the world of visualization, and pedagogical methods from over a decade of training experience, that enables you to: Learn better, faster!
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) CurriculumMJDuyan
(𝐓𝐋𝐄 𝟏𝟎𝟎) (𝐋𝐞𝐬𝐬𝐨𝐧 𝟏)-𝐏𝐫𝐞𝐥𝐢𝐦𝐬
𝐃𝐢𝐬𝐜𝐮𝐬𝐬 𝐭𝐡𝐞 𝐄𝐏𝐏 𝐂𝐮𝐫𝐫𝐢𝐜𝐮𝐥𝐮𝐦 𝐢𝐧 𝐭𝐡𝐞 𝐏𝐡𝐢𝐥𝐢𝐩𝐩𝐢𝐧𝐞𝐬:
- Understand the goals and objectives of the Edukasyong Pantahanan at Pangkabuhayan (EPP) curriculum, recognizing its importance in fostering practical life skills and values among students. Students will also be able to identify the key components and subjects covered, such as agriculture, home economics, industrial arts, and information and communication technology.
𝐄𝐱𝐩𝐥𝐚𝐢𝐧 𝐭𝐡𝐞 𝐍𝐚𝐭𝐮𝐫𝐞 𝐚𝐧𝐝 𝐒𝐜𝐨𝐩𝐞 𝐨𝐟 𝐚𝐧 𝐄𝐧𝐭𝐫𝐞𝐩𝐫𝐞𝐧𝐞𝐮𝐫:
-Define entrepreneurship, distinguishing it from general business activities by emphasizing its focus on innovation, risk-taking, and value creation. Students will describe the characteristics and traits of successful entrepreneurs, including their roles and responsibilities, and discuss the broader economic and social impacts of entrepreneurial activities on both local and global scales.
1. CHAPTER 4
HOW TO DEVELOP A DATA-
DRIVEN MVC WEB APP
By : Eng. Mahmoud Hassouna
Email : M.hassuna2@gmail.com
2. How to start the Movie List app?
1. the Movie List page displays the movie data in a table
2. Above the table, the page displays a link that users can click when
they want to add a new movie.
3. Within the table, each row displays two links users can click when
they want to edit or delete an existing movie.
3. What happened If the user clicks the
Add New Movie link?
The app displays the Add Movie page. This page
displays a form with text boxes that let the user enter
the name, year, and rating for a movie. In addition, it
displays a drop-down list that allows users to select a
genre for the movie.
If the user clicks one of the Edit links in the table on the
Movie List page…
The app displays the Edit Movie page
4. What happened if the user clicks
one of the Delete links?
The app displays the Delete Movie page.
This page simply asks users to confirm that they really want to delete
the selected movie.
If they do, they click the Delete button to delete the movie from the
database.
If they don’t, they click the Cancel button to return the user to the
Movie List page.
10. How to use EF Core:
Entity Framework (EF) Core is an object-relational
mapping (ORM) framework that allows you to work with
the objects of a database in code. In the next few
figures, you’ll learn how to code classes that define the
structure of a database. Then, you’ll learn how to create
a database from this code.
11. How to add EF Core to your project:
Prior to .NET Core 3.0, EF Core and the tools to work with it were
included with ASP.NET Core by default. However, with .NET Core 3.0
and later, you must manually add EF Core and the EF Core Tools to
your project. To do that with Visual Studio, you need to find and
install the correct NuGet packages.
Note:
If you try to install a version of EF Core or EF Core Tools that’s newer
than the version of .NET Core you installed, you might get errors.
12. How to open the NuGet Package
Manager?
Select Tools
Nuget Package
Manager
Manage Nuget
Package for
Solution
14. How to install the EF Core and EF
Core Tools NuGet packages:
1. Click the Browse link in the upper left of the window.
2. Type “Microsoft.EntityFrameworkCore.SqlServer” in the search box.
3. Click on the appropriate package from the list that appears in the left-hand panel.
4. In the right-hand panel, check the project name, select the version that matches
the version of .NET Core you’re running, and click Install.
5. Review the Preview Changes dialog that comes up and click OK.
6. Review the License Acceptance dialog that comes up and click I Accept.
7. Type “Microsoft.EntityFrameworkCore.Tools” in the search box.
8. Repeat steps 3 through 6.
15. How to create a DbContext class
EF Code First:
The most common way to work with EF Core is to code your
model classes first. Then, you can use EF Core to generate a
database from those classes.
The DbContext class:
The primary class for communicating with a database.
The DbContextOptions class:
Provides configuration information to the DbContext class.
16. How to create a DbContext class
cont.
The DbSet class:
Represents a collection of model classes, also known as
entity classes, or domain model classes, that map to a
database table.
20. How to seed initial data
One method of the DbContext class:
21. How to seed initial data cont.
-The MovieContext class updated to seed initial Movie data
22. How to add a connection string
A connection string: is a string that specifies information
that an app needs to connect to a database or other
data source.
To add a connection string, you can hard-code
connection strings in the code for your app, it’s generally
considered a best practice to store them in a
configuration file.
23. How to enable dependency injection
Dependency injection: is a design pattern in which
the services an object needs are passed to it rather than
being hard coded as part of the object.
Core MVC uses dependency injection to pass
DbContext objects to the controllers that need them.
26. How to use migrations to create the
database
The Package Manager Console (PMC) window in Visual Studio
27. How to use migrations to create the
database cont.
How to open the Package Manager Console window:
Select the Tools
NutGet Package
Manager
Package Manager
Console command
How to create the Movies database based on your code files:
1. Make sure the connection string and dependency injection are set up.
2. Type “Add-Migration Initial” in the PMC at the command prompt and press Enter.
3. Type “Update-Database” at the command prompt and press Enter.
28. How to use migrations to create the
database cont.
The code in the Up() method of the Initial migration file:
29. How to use migrations to create the
database cont.
How to view the database once it’s created:
1. Choose the View SQL Server Object Explorer command in Visual Studio.
2. Expand the (localdb)MSSQLLocalDB node, then expand the Databases node.
3. Expand the Movies node, then expand the Tables node.
4. To view the table columns, expand a table node and then its Columns node.
5. To view the table data, right-click a table and select the ViewData command.
30. How to work with data
Work with Data
Select Data
Language-Intergrated
Query(LINQ)
Methods of
DbContext &
DbSet classes
Insert Update Delete
31. How to select Data
Steps to using LINQ and EF Core to select data from a database:
1. build a query expression.
2. execute that query expression at the database.
32. How to select Data cont.
LINQ methods that build or execute a query expression
33. How to select Data cont.
A method of the DbSet class that gets an entity by its id
40. The Movie List app
The Home controller
The Home/Index view
41. The Movie List app
The Home controller
Figure starts by presenting the code for the Home controller of the
Movie List app. This controller starts with a private property named context of
the Movie Context type. Then, the constructor accepts a Movie Context object
and assigns it to the context property. As a result, the other methods in this class
can easily access the Movie Context object.
This constructor works because of the dependency injection code in the
Startup.cs file presented in figure 4-6. That’s because the constructor specifies
that it needs an instance of the MovieContext class. As a result, the MVC
framework creates one based on the options specified in the Startup.cs file and
passes it to that constructor.
The Index() action method of the Home controller uses the context property
to get a collection of Movie objects from the database. But first, it sorts those
objects alphabetically by movie name. Then, it passes that collection to the view.
43. The Movie List app
The Home/Index view
This figure also presents the code for the Home/Index view of the Movie
List app. This view begins by using the @model directive to specify that the
model for this view is a collection of Movie objects because that’s what the
Index() action method of the Home controller passes to this view.
Most of the HTML in this view displays a table of movie data. Just above
the table, a link requests the Add() action method of the Movie controller. This
link allows the user to add a new movie.
Within the body of the table, an inline foreach statement loops through the
collection of Movie objects and displays each one in a row. Within that loop, the
fourth column adds links that request the Edit() and Delete() action methods of
the Movie controller for that specific movie. These links also use the asp-route-id
tag helper to pass the ID for each movie. You’ll learn more about how this tag
helper works in chapter 7. For now, all you need to know is that it appends the
MovieId value for the selected movie to the end of the URL.
48. How to work with related data
How to relate one entity to another
49. How to work with related data
How to update the DbContext class and the seed data
50. How to work with related data
How to use migrations to update the database
51. How to select related data and display it
on the Movie List page
At this point, you’re ready to update the Movie List app so it displays this new
Genre data.
The first example in this figure shows how to update the controller for the Movie
List page. To start, this controller adds a using directive for the EF Core
namespace. Then, the Index() action uses the Include() method of the EF Core
namespace to select the genre data related to each movie.
The Include() method accepts a lambda expression that specifies the related entity.
Whenever necessary, you can chain the Include() method as part of a longer LINQ
query. Like the OrderBy() method, the Include() method doesn’texecute at the
database. Instead, it helps build up the query expression that theToList() method
eventually executes.
52. If you only need the GenreId value, not the data for the entire entity, you don’t need
to use the Include() method. That’s because the Movie entity contains a foreign key
property named GenreId. In other words, the GenreId value is automatically
included when you select a Movie object. However, in this case, you want to get all
the Genre data, not just the GenreId value. As a result, you need to use Include().
Once you’ve selected the related data, you use regular C# dot notation to work with
it. In the second example, for instance, the Home/Index view adds a Genre column
to the movie table. Within the foreach loop, it uses dot notation to display the Name
property of the Genre property of the Movie object.
How to select related data and display
it on the Movie List page
53. How to select related data and display
it on the Movie List page
54. The Add() action method of the Movie controller
How to display related data on the
Add and Edit Movie pages
The Edit() action method of the Movie controller for GET requests
55. The Edit() action method of the Movie controller for POST requests
How to display related data on the
Add and Edit Movie pages
56. How to make URLs lowercase with a trailing slash
How to make user-friendly URLs
By default, MVC uses the names of the controllers and their action
methods
to create the URLs of the app. By convention, these names begin with an
uppercase letter. This produces URLs that use some uppercase letters
like those
shown at the top of figure 4-19.
However, there’s also a convention that URLs should be lowercase. This
makes them easier for users to type. In addition, some developers like to
include
a trailing slash after a URL. This makes it easy for users to add text to
the end of
a URL.
Fortunately, it’s easy to make your MVC app produce URLs that are
lowercase and have a trailing slash. To do that, you just need to adjust
the
57. The default URLs of an MVC app
How to make user-friendly URLs
58. The same MVC pages after changing the URL configuration
How to make user-friendly URLs
Description
• By default, MVC uses the names of the controllers and their action methods to
create the URLs of the app. By convention, these names begin with an uppercase
letter.
• It’s generally considered a good practice to use lowercase letters for URLs.
• Some developers like to include a trailing slash after each URL to make it easy for
users to type text at the end of a URL.
59. How to add a slug
The Edit page with numeric ID values only in the URL
60. How to add a slug
The Edit page after updating the code to add a slug to the URL
Description
• A slug is a descriptive section at the end of a URL. You can add a
slug by adding an optional route parameter named slug to the
Startup.cs file, adding a Slug property to the entity class, and
including the Slug property on a link.