1622186675
Microsoft Build 2021 just wrapped up, and a lot of the new coverage was about things like the upcoming major updates to Windows, the retirement of IE and pre-Chromium Edge, and the new Windows app store that is being developed.
However, this year’s event also included some very exciting news for software developers and teams, including a new version of Windows Terminal and support for Linus GUI apps via the Windows Subsystem for Linux.
I’ve summarized a few of my other favorite tidbits below.
The ASP.NET team is introducing a new way to create APIs with much less overhead than MVC and very little ceremony or wire-up code to write.
app.MapGet("/", async httpContext =>
{
await httpContext.Response.WriteAsync("Hello World!");
});
Read more on the ASP.NET blog.
#.net core #.net #.net maui #asp.net #blazor
1602560783
In this article, we’ll discuss how to use jQuery Ajax for ASP.NET Core MVC CRUD Operations using Bootstrap Modal. With jQuery Ajax, we can make HTTP request to controller action methods without reloading the entire page, like a single page application.
To demonstrate CRUD operations – insert, update, delete and retrieve, the project will be dealing with details of a normal bank transaction. GitHub repository for this demo project : https://bit.ly/33KTJAu.
Sub-topics discussed :
In Visual Studio 2019, Go to File > New > Project (Ctrl + Shift + N).
From new project window, Select Asp.Net Core Web Application_._
Once you provide the project name and location. Select Web Application(Model-View-Controller) and uncheck HTTPS Configuration. Above steps will create a brand new ASP.NET Core MVC project.
Let’s create a database for this application using Entity Framework Core. For that we’ve to install corresponding NuGet Packages. Right click on project from solution explorer, select Manage NuGet Packages_,_ From browse tab, install following 3 packages.
Now let’s define DB model class file – /Models/TransactionModel.cs.
public class TransactionModel
{
[Key]
public int TransactionId { get; set; }
[Column(TypeName ="nvarchar(12)")]
[DisplayName("Account Number")]
[Required(ErrorMessage ="This Field is required.")]
[MaxLength(12,ErrorMessage ="Maximum 12 characters only")]
public string AccountNumber { get; set; }
[Column(TypeName ="nvarchar(100)")]
[DisplayName("Beneficiary Name")]
[Required(ErrorMessage = "This Field is required.")]
public string BeneficiaryName { get; set; }
[Column(TypeName ="nvarchar(100)")]
[DisplayName("Bank Name")]
[Required(ErrorMessage = "This Field is required.")]
public string BankName { get; set; }
[Column(TypeName ="nvarchar(11)")]
[DisplayName("SWIFT Code")]
[Required(ErrorMessage = "This Field is required.")]
[MaxLength(11)]
public string SWIFTCode { get; set; }
[DisplayName("Amount")]
[Required(ErrorMessage = "This Field is required.")]
public int Amount { get; set; }
[DisplayFormat(DataFormatString = "{0:MM/dd/yyyy}")]
public DateTime Date { get; set; }
}
C#Copy
Here we’ve defined model properties for the transaction with proper validation. Now let’s define DbContextclass for EF Core.
#asp.net core article #asp.net core #add loading spinner in asp.net core #asp.net core crud without reloading #asp.net core jquery ajax form #asp.net core modal dialog #asp.net core mvc crud using jquery ajax #asp.net core mvc with jquery and ajax #asp.net core popup window #bootstrap modal popup in asp.net core mvc. bootstrap modal popup in asp.net core #delete and viewall in asp.net core #jquery ajax - insert #jquery ajax form post #modal popup dialog in asp.net core #no direct access action method #update #validation in modal popup
1622186675
Microsoft Build 2021 just wrapped up, and a lot of the new coverage was about things like the upcoming major updates to Windows, the retirement of IE and pre-Chromium Edge, and the new Windows app store that is being developed.
However, this year’s event also included some very exciting news for software developers and teams, including a new version of Windows Terminal and support for Linus GUI apps via the Windows Subsystem for Linux.
I’ve summarized a few of my other favorite tidbits below.
The ASP.NET team is introducing a new way to create APIs with much less overhead than MVC and very little ceremony or wire-up code to write.
app.MapGet("/", async httpContext =>
{
await httpContext.Response.WriteAsync("Hello World!");
});
Read more on the ASP.NET blog.
#.net core #.net #.net maui #asp.net #blazor
1618356240
The conference started with the official release of .NET 5. During the opening keynote, Scott Hunter, director of program management for the .NET team at Microsoft, talked about the significant growth in the .NET ecosystem. Similarly to last year, he stressed the increased adoption of .NET over the previous year (there are currently 5M active .NET developers in all platforms). After that, Hunter went back to the .NET 5, highlighting the performance improvements in the new release and short-demoing topics discussed in the next sessions.
Each of the topics covered in the keynote was presented by a different speaker, all chaired by Scott Hunter. The hands-on demos started with creating a windows desktop app, followed by demos on mobile application development with Xamarin, Visual Studio productivity tools, Blazor, ASP.NET web APIs, and Project Tye (for microservices). Although .NET 5 is not yet the expected unifying platform for all things .NET, at the end of his keynote presentation, Hunter reaffirmed the continued mission of achieving a unified platform:
We continue the journey of unifying the .NET platform. Our vision for one .NET is a unified set of libraries, tools, SDKs, and runtimes. .NET 5 begins this journey by taking everything available at .NET Core and adding several cloud and web investments […].
#.net #.net 5 #microsoft #asp.net core #c# 9 #architecture & design #development #news
1624653660
A useful tool several businesses implement for answering questions that potential customers may have is a chatbot. Many programming languages give web designers several ways on how to make a chatbot for their websites. They are capable of answering basic questions for visitors and offer innovation for businesses.
With the help of programming languages, it is possible to create a chatbot from the ground up to satisfy someone’s needs.
Before building a chatbot, it is ideal for web designers to determine how it will function on a website. Several chatbot duties center around fulfilling customers’ needs and questions or compiling and optimizing data via transactions.
Some benefits of implementing chatbots include:
Some programmers may choose to design a chatbox to function through predefined answers based on the questions customers may input or function by adapting and learning via human input.
#chatbots #latest news #the best way to build a chatbot in 2021 #build #build a chatbot #best way to build a chatbot
1603224000
Recently one of my friends was migrating a project from ASP.Net MVC 5 to ASP.Net core 3.1. One of the challenges he faced is with the Index Attribute in data annotations. The .Net Core is not recognizing the Index attribute. When he copied his class from his MVC 5 project, he got the following error message.
Though the other data annotations accepted by .Net Core, this data attribute “Index” was throwing an exception.
“Index is not an attribute class”
Cool!. Let us dig into the details. You can find the related post on the Entity Framework Github page.
From the page, it is clear now, this is not a bug, the EF Core team didn’t migrate the Index Attribute from the EF 6. So we need to live with this.
Now the question arises, how we are going to add the Indexes to our Tables. The answer is to use the Fluent API in ASP.Net core.
You can refer to the following link on the Microsoft Site to get the details of how to apply the Index to a property.
So the solution is to replace the Index Attribute to the Fluent API, as below.
In real life, you will have many classes, and adding all classes using Fluent API inside OnModelCreating() method will make your code difficult to maintain. The solution is to create a separate class derived from IEntityTypeConfiguration. This will help us define all the related configurations in a single class and then apply the configurations from the OnModelCreating() method.
Let us apply the configuration class for the above. The following is the configuration class.
Once you have the configuration class, you can apply the configuration in the ModelCreating() method as follows.
Happy Coding!
#asp.net #asp.net core 3.1 #.net core #entity framework core #mvc #migration #.net #microsoft