How Logging Works in ASP.NET Core

Akshay Khot
Updated on 22-Jun-2021 14:48:35

7K+ Views

Logging is the process of recording events in software as they happen in real-time, along with other information such as the infrastructure details, time taken to execute, etc. Logging is an essential part of any software application. Having logs is crucial, especially when things go wrong. Logs help you understand the failures or performance bottlenecks and fix the problems.Logs are typically written to a database, console, or file, depending on the severity of the application and convenience. Although it's possible to record any data in the logs, you write informational messages and error messages in general. The informational messages capture ... Read More

Explain the MVC Pattern in ASP.NET

Akshay Khot
Updated on 22-Jun-2021 14:47:55

370 Views

MVC stands for Model-View-Controller. It is an architectural pattern for software applications. Trygve Reenskaug came up with the pattern in 1979 for developing interactive applications. In this pattern, the application is divided into three components: models, views, and controllers.ModelThe model maintains the state of the application. The state can be in transient, i.e. in memory, or persistent, i.e. saved to a database.A model does more than just holding the state. It performs the business logic on the data, enforces the business rules on the data, and can use a domain model to manipulate the data. The model acts as both ... Read More

Role of HttpContext Class in ASP.NET Core

Akshay Khot
Updated on 22-Jun-2021 13:27:54

7K+ Views

The HttpContext encapsulates all the HTTP-specific information about a single HTTP request.When an HTTP request arrives at the server, the server processes the request and builds an HttpContext object. This object represents the request which your application code can use to create the response.The HttpContext object constructed by the ASP.NET Core web server acts as a container for a single request. It stores the request and response information, such as the properties of request, request-related services, and any data to/from the request or errors, if there are any.ASP.NET Core applications access the HTTPContext through the IHttpContextAccessor interface. The HttpContextAccessor class ... Read More

Data Access in ASP.NET Core with Entity Framework

Akshay Khot
Updated on 22-Jun-2021 13:24:03

428 Views

Entity Framework is an ORM (object-relational mapper) framework that makes it easy to create, retrieve, update, or delete data from relational databases. Using Entity Framework, you can work with C# objects that abstract the database related code, so you rarely have to deal with raw SQL.The following figure illustrates where the Entity Framework fits into a layered architecture.Entity Framework Core (EF Core) is the new version of Entity Framework 6. Similar to .NET Core, EF Core is a lightweight, open-source, and cross-platform version of Entity Framework. It is developed to be used with .NET Core applications.To integrate EF Core into ... Read More

Delete a Label in Python Tkinter

Dev Prakash Sharma
Updated on 19-Jun-2021 08:47:30

23K+ Views

Tkinter label widgets are used to display text and images in the application. We can also configure the properties of Label widget that are created by default in a tkinter application.If we want to delete a label that is defined in a tkinter application, then we have to use the destroy() method.ExampleIn this example, we will create a Button that will allow the user to delete the label from the widget.# Import the required libraries from tkinter import * from tkinter import ttk from PIL import Image, ImageTk # Create an instance of tkinter frame or window win = ... Read More

Hide and Show Canvas Items on Tkinter

Dev Prakash Sharma
Updated on 19-Jun-2021 08:34:29

4K+ Views

The Canvas widget is one of the versatile widgets in Tkinter. It is used in many applications for designing the graphical user interface such as designing, adding images, creating graphics, etc. We can add widgets in the Canvas widget itself. The widgets that lie inside the canvas are sometimes called "Canvas Items".If we want to show or hide the canvas items through a Button, then this can be achieved by using the "state" property in itemconfig(id, state) method.ExampleIn this example, we will add an image in the canvas and a button will be used to show/hide the image in the ... Read More

Get the Index of an Item in Tkinter Listbox

Dev Prakash Sharma
Updated on 19-Jun-2021 08:34:09

5K+ Views

We use the Tkinter Listbox widget to create a list of items. Each item in the listbox has some indexes that are assigned to them sequentially in vertical order.Let us suppose that we want to get the index of a clicked item in the listbox. Then, we have to first create a button that will capture the current selection of the items using list.curselection() method and then, we will print the index using the get() method.Example# Import the required libraries from tkinter import * # Create an instance of tkinter frame or window win = Tk() # Set the size ... Read More

Center Text in a Tkinter Text Widget

Dev Prakash Sharma
Updated on 19-Jun-2021 08:33:48

20K+ Views

Tkinter text widget is a multiline text input widget. It is used to insert, delete, and add textual data in the input field. It provides many built-in functions and attributes in its widget class.To configure and align the text at the CENTER of a Tkinter Text widget, we can use justify=CENTER property.Example# Import the required libraries from tkinter import * # Create an instance of tkinter frame or window win=Tk() # Set the size of the window win.geometry("700x350") text=Text(win) # Configure the alignment of the text text.tag_configure("tag_name", justify='center') # Insert a Demo Text text.insert("1.0", "How do ... Read More

Difference Between title() and wm_title() Methods in Tkinter Class

Dev Prakash Sharma
Updated on 19-Jun-2021 08:33:29

1K+ Views

Tkinter has a definite class hierarchy which contains many functions and built-in methods. As we create applications, we use these functions to build the structure of components.The wm class stands for "window manager" that is a mixin class that provides many builtin functions and methods.The method wm_title() is used to change the title of the tkinter window. However, alternatively, we can also use the win.title() method. Generally, wm class provides many methods that let us communicate with the window services.Example# Import the required libraries from tkinter import * # Create an instance of tkinter frame or window win = Tk() ... Read More

Edit Listbox Item in Tkinter

Dev Prakash Sharma
Updated on 19-Jun-2021 08:32:36

4K+ Views

Tkinter Listbox widget is generally used to create a list of items. It can store a list of numbers, characters and support many features like selecting and editing the list items.To edit the Listbox items, we have to first select the item in a loop using listbox.curselection() function and insert a new item after deleting the previous item in the listbox. To insert a new item in the listbox, you can use listbox.insert(**items) function.ExampleIn this example, we will create a list of items in the listbox widget and a button will be used for editing the selected item in the list.# ... Read More

Advertisements