Myah  Conn

Myah Conn

1591735800

Visual Studio .NET Productivity on PC and Mac

Pump up your .NET productivity with the latest additions to Visual Studio and Visual Studio for Mac. This session includes tips for navigating, refactoring, testing, and cleaning up your code.

#visual studio .net #mac #visual studio

What is GEEK

Buddha Community

Visual Studio .NET Productivity on PC and Mac
Myah  Conn

Myah Conn

1591735800

Visual Studio .NET Productivity on PC and Mac

Pump up your .NET productivity with the latest additions to Visual Studio and Visual Studio for Mac. This session includes tips for navigating, refactoring, testing, and cleaning up your code.

#visual studio .net #mac #visual studio

Einar  Hintz

Einar Hintz

1602560783

jQuery Ajax CRUD in ASP.NET Core MVC with Modal Popup

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 :

  • Form design for insert and update operation.
  • Display forms in modal popup dialog.
  • Form post using jQuery Ajax.
  • Implement MVC CRUD operations with jQuery Ajax.
  • Loading spinner in .NET Core MVC.
  • Prevent direct access to MVC action method.

Create ASP.NET Core MVC Project

In Visual Studio 2019, Go to File > New > Project (Ctrl + Shift + N).

From new project window, Select Asp.Net Core Web Application_._

Image showing how to create ASP.NET Core Web API project in Visual Studio.

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.

Showing project template selection for .NET Core MVC.

Setup a Database

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.

Showing list of NuGet Packages for Entity Framework Core

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

Juanita  Apio

Juanita Apio

1618243440

[Guest post] Learn C# with Visual Studio, Visual Studio for Mac, and Unity

UPDATE: The book giveaway challenge is complete. We will be announcing winners on the Visual Studio blog within the next week. Thank you for your submissions!

Visual Studio is an amazing development tool. But Visual Studio and Visual Studio for Mac are more than just intuitive, state-of-the-art development environments. They’re also remarkably powerful learning and exploration tools, with features to help you create and understand your code. I love teaching and learning about C## with Visual Studio. That’s why my co-author, Jenny Greene, and I put Visual Studio and Visual Studio for Mac right at the center of our latest book, _Head First C# _(4th edition), published by O’Reilly Media. _Head First C# _incorporates Visual Studio directly in the learning. combining Visual Studio with the unique and innovative “brain-friendly” Head First approach to teaching helps us make learning C## easier and more fun for our readers.

#visual studio #c# #unity #visual studio 2019 for mac #visual studio for mac

Hertha  Mayer

Hertha Mayer

1599287948

.NET CLI Templates in Visual Studio

One of the values of using tools for development is the productivity they provide in helping start projects, bootstrapping dependencies, etc. One way that we’ve seen developers and companies deliver these bootstrapping efforts is via templates. Templates serve as a useful tool to start projects and add items to existing projects for .NET developers.

Visual Studio has had templates for a long time and .NET Core’s command-line interface (CLI) has also had the ability to install templates and use them via dotnet new commands. However, if you were an author of a template and wanted to have it available in the CLI as well as Visual Studio you had to do extra work to enable the set of manifest files and installers to make them visible in both places. We’ve seen template authors navigate to ensuring one works better and that sometimes leaves the other without visibility. We wanted to change that.

Starting in Visual Studio 16.8 Preview 2 we’ve enabled a preview feature that you can turn on that enables all templates that are installed via CLI to now show as options in Visual Studio as well. To enable this option visit the Preview Features options in the Tools…Options menu and look for the “Show all .NET Core templates in the New Project dialog” (we’re awesome at naming) checkbox and check it:

Image of Preview Features dialog

After enabling you need to restart the Visual Studio instance to get this capability. After restarting and choosing to create a new project you’ll see some slight differences in the experience. The full list of templates is shown and the names are now being driven from the manifest data in the template’s template.json file.

Image of New Project Dialog with templates listed

Previously as an example we had a special dialog for ASP.NET projects. When the new experience is enabled, this no longer exists, and all project templates use the same infrastructure. This new model reads the options to be exposed to the dialog and renders the UI to enable the selection. Here is the example of an ASP.NET Core web application:

#.net #.net core #asp.net #visual studio #cli #visual studio

Aisu  Joesph

Aisu Joesph

1624386660

.NET News Roundup: .NET 6, MAUI, EF Core 6, Visual Studio 2022

It’s been a busy week for the .NET community with the release of new previews for .NET 6 and its related frameworks (including MAUI), along with the first preview of Visual Studio 2022, new Azure SDK libraries, and more. InfoQ examined these and a number of smaller stories in the .NET ecosystem from the week of June 14th, 2021.

This week’s highlight was the release of new previews for .NET 6 and its related frameworks. .NET 6 Preview 5 includes improvements to a new feature named SDK workloads, which - according to Richard Lander, program manager for the .NET team at Microsoft - is the foundation of the .NET unification vision. The new feature allows developers to add support for new application types (such as mobile and WebAssembly) without increasing the size of the SDK. The improvements to the new feature are the inclusion of two new verbs - list and update - providing a sense of the expected final experience with the general availability release in November. Other features in .NET 6 Preview 5 include NuGet package validationmore Roslyn analyzers, improvements in the Microsoft.Extensions APIs (focused on hosting and dependency injection), WebSocket compression, and much more. Also according to Lander, “.NET 6 Preview 5 is perhaps the biggest preview yet in terms of breadth and quantity of features.” A comprehensive list of all features included in the new preview can be found in the official release post.

The ASP.NET Core framework also received significant improvements in .NET 6 Preview 5. One of the most important features of this release is the reduced Blazor WebAssembly download size with runtime relinking. Now developers can use the .NET WebAssembly tools (the same tools also used for .NET WebAssembly AOT compilation) to relink the runtime and remove unnecessary logic, dramatically reducing the size of the runtime. According to Microsoft, the size reduction is particularly relevant when using invariant globalization mode. Other features in the new release include .NET Hot Reload updates for dotnet watch, faster get and set for HTTP headers, and ASP.NET Core SPA templates updated to Angular 11 and React 17.

#azure #.net #.net maui #visual studio 2019 #.net 6 #visual studio 2022 #devops #news