#ASP.NET MVC boilerplate
Explore tagged Tumblr posts
techcronus · 9 months ago
Text
Why Choose ASP.NET for Web Application Development in 2024?
ASP.NET is still a top technology framework for web application development, with a rich ecosystem for building strong, scalable, and secure applications. The most recent improvements in 2024 have increased its capabilities, making it a top choice for businesses globally.
Top Benefits of Using ASP.NET for Web Development in 2024
Improved Performance and Scalability
The most recent ASP.NET upgrades for 2024 provide performance optimization improvements that improve application speed and reduce memory consumption. The framework's built-in caching, asynchronous programming, and support for microservices make it ideal for applications that demand scalability.
Cross-Platform Development with.NET Core.
ASP.NET Core enables developers to create applications that run on a variety of platforms, including Windows, macOS, and Linux. This flexibility enables enterprises to reach a larger audience while also ensuring that their applications are future-proof.
Security Features:
With an increase in cybersecurity threats, ASP.NET includes built-in security capabilities like as request validation, authentication, authorization, and data encryption. The 2024 improvements enhance security by integrating identity and access management technologies.
MVC Architecture 
ASP.NET The MVC architecture separates application functionality and UI layers, allowing developers to write clear, maintainable code. This also improves the application's scalability because individual components can be updated or modified without affecting the entire application.
Support for cloud and microservices.
ASP.NET works well with cloud services such as Azure, allowing developers to create scalable, cloud-native apps. Businesses can use microservices architecture to construct complex applications that are simple to deploy and manage.
What's New in ASP.NET 2024: Key Features and Updates
Improved Blazor IntegrationBlazor, the front-end framework for building interactive web UIs using C#, has seen enhancements in 2024. Developers can now build even more dynamic, real-time applications with enhanced WebAssembly capabilities.
Minimal APIs The latest ASP.NET updates introduce minimal APIs that allow developers to quickly build lightweight, fast web services with reduced boilerplate code. This feature is perfect for startups and businesses needing rapid API development.
Containerization and Kubernetes Integration ASP.NET 2024 comes with better support for containerization, allowing seamless integration with Kubernetes for deploying, managing, and scaling applications. This update enables businesses to adopt modern DevOps practices with ease.
gRPC SupportASP.NET now fully supports gRPC, a high-performance, open-source framework for remote procedure calls. This is particularly useful for building real-time applications that require low-latency communication between services.
Why Hire a Dedicated ASP.NET Developer?
Expertise in ASP.NET EcosystemA dedicated ASP.NET developer brings in-depth knowledge of the framework, ensuring the development process is smooth and efficient. They are skilled in leveraging the latest features and updates to build high-performing web applications.
Cost-Effective DevelopmentHiring a dedicated ASP.NET developer or team ensures cost-effective development. Outsourcing or remote hiring allows you to access top talent without the overhead costs associated with full-time, in-house staff.
Customization and ScalabilityA dedicated ASP.NET developer can tailor your application to meet your unique business needs and ensure scalability as your business grows. They can also provide ongoing support and maintenance.
Faster Time to MarketExperienced ASP.NET developers can accelerate the development process, allowing you to launch your application faster and gain a competitive edge.
Techcronus – Your Trusted ASP.NET Development Partner
At Techcronus, we specialize in building high-performance web applications using ASP.NET. Our team of certified ASP.NET developers delivers customized solutions to meet your business goals. Whether you're looking to build a new application or optimize an existing one, Techcronus can help you at every step.
Contact us today! Contact No: +91 79-40399641 / +1 (415) 234-7510 Email: [email protected] 
For more information, visit our official website to explore our services and case studies.
0 notes
kodehashtechnology · 1 year ago
Text
Powering the Future: Top Backend Frameworks for Developers in 2024
Tumblr media
The backend, the unseen engine that drives web applications, is undergoing constant evolution. Backend frameworks provide developers with essential tools and structures to build robust, scalable, and secure web applications. In 2024, several established frameworks continue to dominate the landscape, while new contenders emerge with exciting features. This guide explores the top backend frameworks developers should consider for their 2024 projects.
Established Powerhouses:
Django (Python):
A mature and versatile framework known for its "batteries included" philosophy, providing a wide range of built-in features for rapid development.
Ideal for complex web applications, e-commerce platforms, and content management systems (CMS) due to its robust security features and scalability.
Python's popularity and extensive libraries further enhance Django's appeal.
Spring Boot (Java):
A popular choice for enterprise-level applications, known for its modular design and focus on developer productivity.
Simplifies development by auto-configuration and dependency injection, reducing boilerplate code.
Spring Boot's vast ecosystem of libraries and tools caters to diverse project needs.
Laravel (PHP):
A feature-rich framework offering a clean and expressive syntax for PHP development.
Laravel excels at building APIs and web applications with robust security features and a thriving community.
Its focus on rapid development and MVC (Model-View-Controller) architecture makes it popular for building complex web projects.
ASP.NET Core (C#):
Microsoft's open-source framework for building modern web applications.
Offers cross-platform compatibility, allowing development for Windows, Linux, and macOS.
Strong integration with other Microsoft technologies like Azure cloud platform makes it attractive for enterprise development.
Rising Stars:
FastAPI (Python):
Gaining rapid traction for its focus on high performance and developer experience.
Leverages Python's type hints for static type checking, enhancing code reliability.
Ideal for building modern APIs requiring speed, efficiency, and a clean development workflow.
NestJS (JavaScript/TypeScript):
A server-side framework for building scalable Node.js applications with a strong focus on architecture and testability.
Employs TypeScript for static typing and leverages design patterns like dependency injection for better code organization.
Ideal for large-scale, complex web applications requiring a structured and maintainable codebase.
Choosing the Right Framework:
Selecting the best backend framework depends on your project's specific needs and your team's skillset. Here are some key factors to consider:
Project Requirements: Evaluate the complexity, scale, and performance needs of your project.
Programming Language Expertise: Choose a framework built on a language your team is comfortable with.
Development Speed and Maintainability: Consider the framework's features and structure to optimize development efficiency and code maintainability.
Security: Prioritize frameworks with a strong focus on security best practices.
Community and Support: A large and active community allows for easier access to support and learning resources.
Beyond the Framework: The Importance of Skills
While frameworks provide valuable tools, developer skillset remains paramount. A strong understanding of programming languages, object-oriented programming (OOP) principles, database management, and security best practices is essential for building robust backend applications.
The Future of Backend Frameworks
The future of backend frameworks lies in:
Microservices Architecture: Breaking down applications into smaller, independent services for increased scalability and maintainability.
Cloud-Native Development: Optimizing frameworks for deployment and management on cloud platforms like AWS, Azure, and Google Cloud Platform (GCP).
Artificial Intelligence (AI) Integration: Leveraging AI for tasks like code generation, testing, and performance optimization.
Conclusion:
Backend frameworks empower developers to build the backbone of the digital world. In 2024, the established powerhouses continue to deliver, while rising stars like FastAPI and NestJS offer exciting possibilities for modern web application development. By understanding your project needs, considering these factors, and fostering strong developer skills, you can choose the framework that helps you build successful and future-proof applications.
0 notes
quantuminnovationit · 1 year ago
Text
Ruby on Rails vs. Other Web Development Frameworks: A Comparison
Tumblr media
Ruby on Rails (RoR) has long been a stalwart in the world of web development, known for its elegant syntax, convention over configuration philosophy, and rapid development capabilities. As businesses seek the most suitable web development framework for their projects, a comparison of Ruby on Rails against other frameworks becomes imperative. In this exploration, we analyze the strengths, weaknesses, and unique features of Ruby on Rails in contrast to other popular web development frameworks. Leading ruby on rails website development company usa are navigating this landscape, utilizing the framework's potential to craft robust and scalable web applications.
Ruby on Rails Web Development Company USA: Setting the Standard
In the United States, where the demand for dynamic and efficient web applications is ever-growing, Ruby on Rails continues to set the standard for web development. With a focus on developer happiness and productivity, RoR empowers Ruby on Rails web development companies in the USA to create feature-rich applications swiftly. Its convention over configuration approach streamlines development processes, allowing developers to focus on application logic rather than spending time on boilerplate code.
RoR Website Development Company USA: Harnessing Convention Over Configuration
One of the defining features of Ruby on Rails is its convention over configuration principle. This philosophy minimizes the need for developers to specify configuration details, as the framework makes assumptions based on conventions. For RoR website development companies USA, this translates to accelerated development cycles and a standardized structure that enhances code readability and maintainability.
Comparison with Other Web Development Frameworks
Ruby on Rails vs. Django (Python): The Battle of High-Level Frameworks
Ruby on Rails and Django, a high-level web framework for Python, share similarities in their approach to rapid development. Both frameworks prioritize developer convenience, offering pre-built modules and conventions. However, Ruby on Rails is renowned for its emphasis on elegant syntax, favoring convention over configuration, while Django follows the "explicit is better than implicit" philosophy.
Ruby on Rails vs. Laravel (PHP): PHP's Modern Counterpart
In the PHP realm, Laravel emerges as a modern counterpart to Ruby on Rails. Both frameworks prioritize developer-friendly syntax, offer robust features, and follow the Model-View-Controller (MVC) architectural pattern. Laravel, inspired by the simplicity and elegance of Ruby on Rails, brings similar conventions to PHP developers. However, the choice between the two often depends on the language preference and specific project requirements.
Ruby on Rails vs. Express.js (Node.js): JavaScript in the Mix
Express.js, a minimalist web framework for Node.js, stands as a JavaScript alternative to Ruby on Rails. While Ruby on Rails adopts a comprehensive approach to web development, including conventions and a full-stack framework, Express.js is minimalistic and allows developers greater flexibility in choosing components. The decision between the two often hinges on the developer's preference for the Ruby or JavaScript ecosystem.
Ruby on Rails vs. ASP.NET (C#): The Microsoft Framework
ASP.NET, powered by C#, is a robust web development framework from Microsoft. While Ruby on Rails is known for its agility and simplicity, ASP.NET offers a comprehensive ecosystem and integration with Microsoft technologies. The choice between the two often depends on factors such as project scale, existing infrastructure, and the development team's familiarity with the respective languages.
ROR Web Development Company in USA: Adapting to Changing Trends
As technology evolves, so does the landscape of web development. Leading RoR web development companies in the USA are not only adept at harnessing the core features of Ruby on Rails but are also adaptable to changing trends. The ecosystem surrounding RoR, including its vibrant community and extensive library of gems (Ruby packages), ensures that developers can seamlessly integrate new technologies and best practices into their projects.
Conclusion: Deciding on the Right Framework
In conclusion, the choice between Ruby on Rails and other web development frameworks ultimately depends on various factors such as project requirements, developer expertise, and language preferences. As businesses in the USA seek to build dynamic and scalable web applications, collaborating with a reputable ruby on rails web development company usa becomes pivotal. Whether it's leveraging the convention over configuration philosophy, harnessing the elegance of Ruby, or adapting to changing technological landscapes, Ruby on Rails remains a formidable choice in the ever-evolving world of web development.
0 notes
concettolabs · 5 years ago
Link
Tumblr media
0 notes
jaxonjack2 · 3 years ago
Text
3 Reasons Why use Laravel over PHP
Tumblr media
A crucial requirement for any programmer is a thorough knowledge of web frameworks and the best way to use these when creating apps. These are the tools by which modern mobile and web applications are constructed, and they can save you time. They're tested for bugs, and they keep your code tidy and easy to access. Hire Laravel developer for your new project. Now it's time to use the latest technologies and frameworks for PHP.
If you're a PHP developer, the chances are you've used Laravel; it's a relatively new framework that's simple to understand yet with exciting features. Laravel has become a household name in the last 10 years; according to a survey conducted by JetBrains, 50% of PHP developers claim to employ Laravel frequently, compared to 25% in the second most popular framework Symfony. The data obtained from Google patterns also reveals how Laravel has risen above Symfony or other frameworks when searching various PHP frameworks. It powers the web pages of several large international brands, including the significant pharmaceuticals Pfizer and Pfizer, the British Broadcasting Company (BBC), which rely on mobile and web applications to reach enormous global viewers.
What makes Laravel so popular for web development currently? Before we tackle this question, it's worth noting the continuing importance of PHP. As we've discussed in this blog before, PHP is a popular server-side programming language that was first introduced in the mid-1990s and has continued to defy the notion that PHP is disappearing'. In reality, W3Techs has calculated that around 79% of websites are using PHP. The language, a percentage that has remained pretty steady in the past year. In perspective, PHP's closest competitor in terms of use is ASP.NET; however, it's only utilized in 9.1 per cent of websites. The more modern alternatives to PHP like Python receive the spotlight in the present - with a reasonable justification and in many ways. However, they're still only found in a tiny proportion of websites. Hire Laravel developer to transform your website and grow your business.
3 Reasons Why use Laravel over PHP
1 - Simplicity
A big part of the appeal for any language of programming is its user-friendliness. Developers don't want to be stuck in complicated codes that are messy, and companies don't need to wait for their next web-based application. Laravel is a slick and elegant syntax that's easy for novice programmers to understand and develop projects speedily. The framework is based on the model-view-controller (MVC) architectural pattern that facilitates the management of complex and large-scale projects. It also provides various libraries, tools and templates that allow developers to create sophisticated and reliable web applications more efficiently while still allowing flexibility.
2 - Advanced Integrated Features
Alongside simple code, Laravel can address other problems with simple, pre-programmed systems that are easily integrated into applications with just a few lines of code. These "packages" can be specific to Laravel or be used with other PHP frameworks; however, they are simple to install with Composer. For instance, take the Laravel Cashier as an example, which has a built-in subscription billing function that handles all boilerplate code and Socialite, a simple authentication method for social networks like Facebook or Google. An extensible framework and a wide range of tools allow developers to quickly and quickly add features to web-based applications.
3 - Security
This is among the most important considerations of any web framework. Although it isn't 100% secure, Laravel has strong credentials. The in-built CSRF token can deal with any online threat that protects the web application against the most severe security threats (e.g. the SQL Injection). The framework's security ecosystem includes robust community support and tutorials for developers to develop a water-tight app.
0 notes
suzanneshannon · 4 years ago
Text
Exploring a minimal Web API with ASP.NET Core 6
I write about minimal Web APIs in 2016 and my goal has always been for "dotnet server.cs" to allow for a single file simple Web API. Fast forward to 2021 and there's some great work happening again in the minimal API space!
Let's do a 'dotnet new web' with the current .NET 6 preview. I'm on .NET 6 preview 7. As mentioned in the blog:
We updated .NET SDK templates to use the latest C# language features and patterns. We hadn’t revisited the templates in terms of new language features in a while. It was time to do that and we’ll ensure that the templates use new and modern features going forward.
The following language features are used in the new templates:
Top-level statements
async Main
Global using directives (via SDK driven defaults)
File-scoped namespaces
Target-typed new expressions
Nullable reference types
This is pretty cool. Perhaps initially a bit of a shock, but this a major version and a lot of work is being done to make C# and .NET more welcoming. All your favorite things are still there and will still work but we want to explore what can be done in this new space.
Richard puts the reasoning very well:
The templates are a much lower risk pivot point, where we’re able to set what the new “good default model” is for new code without nearly as much downstream consequence. By enabling these features via project templates, we’re getting the best of both worlds: new code starts with these features enabled but existing code isn’t impacted when you upgrade.
This means you'll see new things when you make something totally new from scratch but your existing stuff will mostly work just fine. I haven't had any trouble with my sites.
Let's look at a super basic hello world that returns text/plain:
var builder = WebApplication.CreateBuilder(args); var app = builder.Build(); if (app.Environment.IsDevelopment()){ app.UseDeveloperExceptionPage(); } app.MapGet("/", () => "Hello World!"); app.Run();
Slick. Note that I made line 3 (which is optional) just be one line to be terse. Not needed, just trying on these new shoes.
If we make this do more and support MVC, it's just a little larger. I could add in app.MapRazorPages() if I wanted instead of MapControllerRoute, which is what I use on my podcast site.
var builder = WebApplication.CreateBuilder(args); // Add services to the container. builder.Services.AddControllersWithViews(); var app = builder.Build(); // Configure the HTTP request pipeline. if (app.Environment.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler("/Home/Error"); // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); } app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseRouting(); app.UseAuthorization(); app.MapControllerRoute( name: "default", pattern: "{controller=Home}/{action=Index}/{id?}"); app.Run();
Back to the original Web API one. I can add Open API support by adding a reference to Swashbuckle.AspNetCore and then adding just a few lines:
var builder = WebApplication.CreateBuilder(args); builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); var app = builder.Build(); if (app.Environment.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseSwagger(); app.MapGet("/", () => "Hello World!"); app.UseSwaggerUI(); app.Run();
Then I hit https://localhost:5001/swagger and I get the SwaggerUI and a little WebAPI Tester:
Anuraj has a great blog where he goes deeper and pokes around David Fowlers GitHub and creates a minimal WebAPI with Entity Framework and an in-memory database with full OpenAPI support. He put the source at at https://github.com/anuraj/MinimalApi so check that out.
Bipin Joshi did a post also earlier in June and explored in a bit more detail how to hook up to real data and noted how easy it was to return entities with JSON output as the default. For example:
app.UseEndpoints(endpoints => { endpoints.MapGet("/api/employees",([FromServices] AppDbContext db) => { return db.Employees.ToList(); }); ...snip... }
That's it! Very clean.
Dave Brock did a tour as well and did Hello World in just three lines, but of course, you'll note he used WebApplication.Create while you'll want to use a Builder as seen above for real work.
var app = WebApplication.Create(args); app.MapGet("/", () => "Hello World!"); await app.RunAsync();
Dave does point out how nice it is to work with simple models using the C# record keyword which removes a LOT of boilerplate cruft.
Check this out!
var app = WebApplication.Create(args); app.MapGet("/person", () => new Person("Scott", "Hanselman")); await app.RunAsync(); public record Person(string FirstName, string LastName);
That's it, and if you hit /person you'll get back a nice JSON WebAPI with this result:
{ firstName: "Scott", lastName: "Hanselman" }
Dig even deeper by checking out Maria Naggaga's presentation in June that's on YouTube where she talks about the thinking and research behind Minimal APIs and shows off more complex apps. Maria also did another great talk in the same vein for the Microsoft Reactor so check that out as well.
Is this just about number of lines of code? Have we moved your cheese? Will these scale to production? This is about enabling the creation of APIs that encapsulate best practices but can give you the "middleware-like" performance with the clarity and flexibility that was previous available with all the ceremony of MVC.
Here's some more resources:
David Fowler's GitHub demo https://github.com/davidfowl/dotnet6minimalapi/tree/main/Dotnet6_Minimal_API
A ToDo API as a Minimal API https://github.com/davidfowl/CommunityStandUpMinimalAPI
Exploring what Integration Testing looks like in a .NET 6 world by Martin Costello https://github.com/martincostello/dotnet-minimal-api-integration-testing I'll be exploring Martin's codebase next!
Have fun! Lots of cool things happening this year, even in the middle of the panini. Stay safe, friends.
Sponsor: Pluralsight helps teams build better tech skills through expert-led, hands-on practice and clear development paths. For a limited time, get 50% off your first month and start building stronger skills.
© 2021 Scott Hanselman. All rights reserved.
Tumblr media Tumblr media Tumblr media Tumblr media
     Exploring a minimal Web API with ASP.NET Core 6 published first on https://deskbysnafu.tumblr.com/
0 notes
philipholt · 4 years ago
Text
Exploring a minimal Web API with ASP.NET Core 6
I write about minimal Web APIs in 2016 and my goal has always been for "dotnet server.cs" to allow for a single file simple Web API. Fast forward to 2021 and there's some great work happening again in the minimal API space!
Let's do a 'dotnet new web' with the current .NET 6 preview. I'm on .NET 6 preview 7. As mentioned in the blog:
We updated .NET SDK templates to use the latest C# language features and patterns. We hadn’t revisited the templates in terms of new language features in a while. It was time to do that and we’ll ensure that the templates use new and modern features going forward.
The following language features are used in the new templates:
Top-level statements
async Main
Global using directives (via SDK driven defaults)
File-scoped namespaces
Target-typed new expressions
Nullable reference types
This is pretty cool. Perhaps initially a bit of a shock, but this a major version and a lot of work is being done to make C# and .NET more welcoming. All your favorite things are still there and will still work but we want to explore what can be done in this new space.
Richard puts the reasoning very well:
The templates are a much lower risk pivot point, where we’re able to set what the new “good default model” is for new code without nearly as much downstream consequence. By enabling these features via project templates, we’re getting the best of both worlds: new code starts with these features enabled but existing code isn’t impacted when you upgrade.
This means you'll see new things when you make something totally new from scratch but your existing stuff will mostly work just fine. I haven't had any trouble with my sites.
Let's look at a super basic hello world that returns text/plain:
var builder = WebApplication.CreateBuilder(args); var app = builder.Build(); if (app.Environment.IsDevelopment()){ app.UseDeveloperExceptionPage(); } app.MapGet("/", () => "Hello World!"); app.Run();
Slick. Note that I made line 3 (which is optional) just be one line to be terse. Not needed, just trying on these new shoes.
If we make this do more and support MVC, it's just a little larger. I could add in app.MapRazorPages() if I wanted instead of MapControllerRoute, which is what I use on my podcast site.
var builder = WebApplication.CreateBuilder(args); // Add services to the container. builder.Services.AddControllersWithViews(); var app = builder.Build(); // Configure the HTTP request pipeline. if (app.Environment.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler("/Home/Error"); // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); } app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseRouting(); app.UseAuthorization(); app.MapControllerRoute( name: "default", pattern: "{controller=Home}/{action=Index}/{id?}"); app.Run();
Back to the original Web API one. I can add Open API support by adding a reference to Swashbuckle.AspNetCore and then adding just a few lines:
var builder = WebApplication.CreateBuilder(args); builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); var app = builder.Build(); if (app.Environment.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseSwagger(); app.MapGet("/", () => "Hello World!"); app.UseSwaggerUI(); app.Run();
Then I hit https://localhost:5001/swagger and I get the SwaggerUI and a little WebAPI Tester:
Anuraj has a great blog where he goes deeper and pokes around David Fowlers GitHub and creates a minimal WebAPI with Entity Framework and an in-memory database with full OpenAPI support. He put the source at at https://github.com/anuraj/MinimalApi so check that out.
Bipin Joshi did a post also earlier in June and explored in a bit more detail how to hook up to real data and noted how easy it was to return entities with JSON output as the default. For example:
app.UseEndpoints(endpoints => { endpoints.MapGet("/api/employees",([FromServices] AppDbContext db) => { return db.Employees.ToList(); }); ...snip... }
That's it! Very clean.
Dave Brock did a tour as well and did Hello World in just three lines, but of course, you'll note he used WebApplication.Create while you'll want to use a Builder as seen above for real work.
var app = WebApplication.Create(args); app.MapGet("/", () => "Hello World!"); await app.RunAsync();
Dave does point out how nice it is to work with simple models using the C# record keyword which removes a LOT of boilerplate cruft.
Check this out!
var app = WebApplication.Create(args); app.MapGet("/person", () => new Person("Scott", "Hanselman")); await app.RunAsync(); public record Person(string FirstName, string LastName);
That's it, and if you hit /person you'll get back a nice JSON WebAPI with this result:
{ firstName: "Scott", lastName: "Hanselman" }
Dig even deeper by checking out Maria Naggaga's presentation in June that's on YouTube where she talks about the thinking and research behind Minimal APIs and shows off more complex apps. Maria also did another great talk in the same vein for the Microsoft Reactor so check that out as well.
Is this just about number of lines of code? Have we moved your cheese? Will these scale to production? This is about enabling the creation of APIs that encapsulate best practices but can give you the "middleware-like" performance with the clarity and flexibility that was previous available with all the ceremony of MVC.
Here's some more resources:
David Fowler's GitHub demo https://github.com/davidfowl/dotnet6minimalapi/tree/main/Dotnet6_Minimal_API
A ToDo API as a Minimal API https://github.com/davidfowl/CommunityStandUpMinimalAPI
Exploring what Integration Testing looks like in a .NET 6 world by Martin Costello https://github.com/martincostello/dotnet-minimal-api-integration-testing I'll be exploring Martin's codebase next!
Have fun! Lots of cool things happening this year, even in the middle of the panini. Stay safe, friends.
Sponsor: Pluralsight helps teams build better tech skills through expert-led, hands-on practice and clear development paths. For a limited time, get 50% off your first month and start building stronger skills.
© 2021 Scott Hanselman. All rights reserved.
Tumblr media Tumblr media Tumblr media Tumblr media
     Exploring a minimal Web API with ASP.NET Core 6 published first on http://7elementswd.tumblr.com/
0 notes
praeclarum · 8 years ago
Text
Xamarin.Forms on the Web
TLDR: I implemented a web backend for Xamarin.Forms so that it can run in any browser. It achieves this without javascript recompilation by turning the browser into a dumb terminal fully under the control of the server (through web sockets using a library I call Ooui). This crazy model turns out to have a lot of advantages. Try it here!
A Need
I have been enjoying building small IoT devices lately. I've been building toys, actual household appliances, and other ridiculous things. Most of these devices don't have a screen built into them and I have found that the best UI for them is a self-hosted website. As long as the device can get itself on the network, I can interact with it with any browser.
There's just one problem...
The Web Demands Sacrifice
The web is the best application distribution platform ever made. Anyone with an internet connection can use your app and you are welcome to monetize it however you want. Unfortunately, the price of using this platform is acuquiecense to "web programming". In "web programming", your code and data are split between the client that presents the UI in a browser and the server that stores and executes application data and logic. The server is a dumb data store while the client executes UI logic - only communicating with the server at very strategic points (because synchronization is hard yo). This means that you spend the majority of your time implementing ad-hoc and buggy synchronization systems between the two. This is complex but is only made more complex when the server decides to get in on the UI game by rendering templates - now your UI is split along with your data.
Getting this right certainly is possible but it takes a lot of work. You will write two apps - one server and one client. You will draw diagrams and think about data state flows. You will argue about default API parameters. You will struggle with the DOM and CSS because of their richness in both features and history. You will invent your own security token system and it will be hilarious. The web is great, but it demands sacrifices.
(And, oh yes, the server and client are usually written in different languages - you have that barrier to deal with too. The node.js crew saw all the challenges of writing a web app and decided that the language barrier was an unnecessary complication and removed that. Bravo.)
Something Different
I was getting tired of writing HTML templates, CSS, REST APIs, and all that other "stuff" that goes into writing a web app. I just wanted to write an app - I didn't want to write all this boilerplate.
I decided that what I really wanted was a way to write web apps that was indistinguishable (from the programmer's perspective) from writing native UI apps. If I wanted a button, I would just new it up and add it to other UI elements. If I wanted to handle a click event, I wanted to be able to just subscribe to the event and move on. What I needed was a little magic - something to turn my simple app into the server/client split required by web apps.
That magic is a library I call Ooui. Ooui is a small .NET Standard 2.0 library that contains three interesting pieces of technology:
A shadow DOM that gives a .NET interfaces to the web DOM. It has all the usual suspects <div>, <span>, <input>, etc. along with a styling system that leverages all the power of CSS.
A state-synchronization system. This is where the magic happens. All shadow DOM elements record all the operations that have ever been performed on them. This includes changes to their state (setting their inner text for example) but also methods that have been called (for instance, drawing commands to <canvas>). This state can then be transmitted to the client at any time to fully mirror the server state on the client. With this system, all logic is executed on the server while the client renders the UI. Of course, it also allows for the client to transmit events back to the server so that click events and other DOM events can be handled. This is the part of Ooui that I am the most proud of.
A self-hosting web server (with web sockets) or ASP.NET Core action handlers to make running Ooui very easy. If I want to self-host a button, I simply write:
var button = new Button { Text = "Click Me!" }; button.Clicked += (s, e) => button.Text = "Thanks!"; // Start a web server and serve the interactive button at /button UI.Publish("/button", button);
I can do this from any platform that supports .NET Standard 2. I can run this on a Mac, Linux, Windows, Raspberry PI, etc.
Alternatively, you can host it on an ASP.NET MVC page if you want it up on the internet:
public class HomeController : Controller { public IActionResult Index() { var button = new Button { Text = "Click Me!" }; button.Clicked += (s, e) => button.Text = "Thanks!"; // Return interactive elements using the new ElementResult return new ElementResult(button); } }
Pretty neat huh?
But one more thing...
Xamarin.Forms Support
The DOM is great and all, but what do .NET developers really love when you get right down to it? XAML. This little serialization-format-that-could has become the standard way to build .NET UIs. Whether you're writing a Windows, UWP, or mobile app, you expect there to be XAML support.
So I made XAML work on the web by implementing a new web platform for Xamarin.Forms. Now, any of your Xamarin.Forms apps can run on the web using ASP.NET.
Xamarin.Forms was not at all on my radar when I was building Ooui. Eventually though I realized that it was the perfect basis for a web version of Forms. I thought the idea to be a little silly to be honest - web developers love their CSS and I didn't think there was much point. But one day I heard someone ask for just that feature and I thought "now we're two".
I had never written a backend for Xamarin.Forms but found the process very straightforward and very easy given its open sourceness (e.g. I copied a lot of code from the iOS implementation :-)). There's still a bit of work to be done but Xamarin.Forms and Ooui are getting along like long-lost cousins.
Animations work, pages and layouts work, styling works (as far as I have implemented), and control renders are currently being implemented. Fonts of course are an annoyance and cause a little trouble right now, but it's nothing that can't be fixed.
Once I got Xamarin.Forms working on the web I realized how wrong I was for thinking this to be a silly technology. Writing web apps with the Forms API is a real pleasure that I hope you'll get to experience for yourself.
Now that I am officially releasing Ooui, I want to work on a roadmap. But for now I mostly just want to hear people's opinions. What do you think about all this? What are your concerns? How do you think you could use it? Do you think it's as cool as I do? (Sorry, that last one is a little leading...)
13 notes · View notes
manektechworld · 6 years ago
Text
ASP.NET Zero is an Effective Solution for Creating Web and Mobile Apps
Software outsourcing is a way to deploy the organization internal work to some external agency. These agencies could be situated overseas or in the same geographical constant. Hiring an outsource partner is tricky and when a company decides of hiring the external support, its choice of finding a suitable outsourcing partner depends on several crucial considerable thoughts. Outsourcing is not merely a signed agreement between two parties but it could be termed as the growing relation between the client and the outsourced agency for better future project and expanding prospects.
ASP.NET Zero is a ready-made solution that comes with all out-of-the-box functionality for most standard web and Mobile application solution. In fact, this is a good start for the project where the main functionality is ready and you do not need to spend time developing basic functionality and you can immediately proceed to developing business logic and unique solutions.
ASP.NET Zero Features
1. It provides a layered, well-defined and documented architectural model. 2. It's give the predefined scalation / architecture for the application 3. It provides a strong infrastructure and development model for modularity, multi-tenancy, caching, background jobs, data filters, setting management, domain events, unit & integration testing . You focus on your business code and don't repeat yourself! 4. It's based on the open-source and community-driven ABP framework. 5. It makes your daily development easier by providing base classes and infrastructure, and automates your repeated tasks. 6. ASP.NET Zero uses Metronic as the UI theme. 7. Metronic is one of the world's most popular, strongest and richest UI themes, probably even the first. 8. Version and feature management UI 9. Notification system along with real time chat and emails 10. Provides User profile, account linking, social logins 11. Many built-in solutions (extension libraries) for dependency injection, logging, caching, localization, configuration and so on. These are independent from the
ASP.NET Core and usable for any type of application.
1. Repositories (that can be used as is without developing custom extensions) 2. Unit of Work (application service can be decorated with a transactional aspect) 3. Server-side validation (via data annotations or custom validators) 4. Dynamic Web API controllers (automatically-generated web API layer for your application layer) 5. Background Services (jobs) 6. Real Time Services (SignalR integration) 7. Xamarin mobile application
Provide Multiple solution for the Web/Mobile development
1. ASP.NET Core 2.x and Angular 7.x based Single-Page Application (SPA) solution for your web application (with .NET Framework 4.6.1 / .NET Core options) 2. ASP.NET Core 2.x and jQuery based solution for your web application (with .NET Framework 4.6.1 / .NET Core options) 3. ASP.NET MVC 5.x, Web API and AngularJS 1.x based Single-Page Application (SPA) solution for your web application 4. ASP.NET MVC 5.x and jQuery based solution for your web application 5. XAMARIN mobile application integrated with the backend solution. 6. ASP.NET Core/MVC based application for your public web site
Multi-tenancy
1. Tenant and Edition (package) management for SaaS applications 2. Subscription management & recurring payments 3. PayPal & Stripe integration 4. Dashboard for edition, tenant & income statistics 5. Single database, database per tenant and hybrid database support 6. Custom tenant logo and CSS support 7. Can work in multi-tenant and single-tenant modes
Authentication & Authorization
1. Based on ASP.NET Identity Framework 2. User & role management pages 3. Hierarchical organization units system to group users and entities 4. User login, register, password-reset and email validation pages 5. User, role and permission based flexible authorization 6. User and Tenant impersonation 7. User account linking 8. Two Factor Authentication (Email, SMS, Google Authenticator) 9. User Lockout 10. LDAP/Active Directory login support 11. Active Directory Federation Service (ADFS) Authentication 12. Social media logins (Facebook, Twitter, Google+ and Microsoft Account implemented) 13. OpenId Connect Authentication 14. Log and show all login attempts for users 15. Password complexity settings 16. Automatic Cross-Site Request Forgery (CSRF) protection 17. IdentityServer4 integration
Rapid Application Development
1. Templating support to generate customized code
Mobile Application
1. Cross-platform (iOS & Android) Xamarin mobile application 2. Integrated with the backend API 3. Provides infrastructure for common development tasks
Dynamic Ui Localization
1. Fully localized UI 2. Can add, remove and translate languages on UI 3. RTL and LTR support 4. English, Chinese, German, French, Italian, Russian, Portuguese (Brazil), Spanish (Mexico), Spanish (Spain), Turkish and Arabic localizations are included
Setting Management
1. Host & tenant-specific setting pages 2. Hierarchical setting management infrastructure 3. Easily configurable
Solid Architecture
1. Clean source code in a well-defined solution structure 2. Layered & modular architecture 3. Domain Driven Design implementation 4. Dependency injection everywhere 5. Validation 6. Logging 7. Exception handling 8. Caching 9. Automatic audit/security logging 10. Automatic database connection management and unit of work implementation 11. Pre-configured to deploy as Docker containers 12. Application functionalities are also available as HTTP API 13. Real-time push notification system (with SignalR integration) 14. Chat system (with SignalR integration) 15. Background job system (with Hangfire integration) 16. Multiple time zone support for application, tenants and users 17. Built-in global event bus for server-side events (with pre-defined events for entity changes) 18. Show and download logs from UI 19. Application setup screen 20. Personalization of layout, header, menu and footer per user 21. Tested on major PAAS providers (Azure, AWS)
Based on Strong Frameworks
1. .NET Framework 4.6.x / .NET Core 2.x (cross-platform support) 2. ASP.NET Core / ASP.NET MVC & Web API 3. EntityFramework Code-First and Migrations 4. Angular, Bootstrap, AutoMapper... 5. ASP.NET Boilerplate
Based on Metronic Theme
1. Bootstrap based 2. Responsive design 3. Multiple layout options 4. Metronic UI and components
We, at Manektech, always support the way our client wants to handle their project and we have talented and experienced software developers with us for all your technical needs. With years of experience in IT industry, ManekTech provides the best solution for your IT needs, our experiences software professionals associated with us and we always thrives to provide the expert solution to all your technical needs. We invite you to visit us for all your technical need with the best possible solution.
0 notes
decoupledlogic · 6 years ago
Text
Welcome to Simple Town, My Notes on ASP.NET Razor Pages
Welcome to Simple Town, My Notes on ASP.NET Razor Pages
So, I took some time to finally look into Razor Pages and I was impressed and actually enjoyed the experience. Razor Pages simplify web development compared to MVC. Razor Pages reminds me of my failed attempts at MVP with Web Forms, but much less boilerplate. Feels like MVVM and still has the good parts of MVC. That’s because Razor Pages is MVC under the covers. I was able to immediately get some…
View On WordPress
0 notes
topicprinter · 8 years ago
Link
Our co-founder Charles Ouellet (main author) and I just published this piece on our startup blog, and I thought it'd be cool to also share it here! Enjoy :)"I say we go for a full refactoring of the app in React."Our new dev was excited. Green and filled with confidence."This wouldn't be a smart decision," I replied as softly as I could (I didn't want to shut him off too harshly). After all, a part of me did share his enthusiasm. I, too, had read the React docs. I, too, would have loved to play around with it.But another part of me--the one trying to run a successful business--knew better. Our startup's tech stack couldn't be changed on a whim. At least not anymore.As developers, we love trying the new and discarding the old. A few months after shipping code we're proud of, we're quick to trade pride for shame. Amidst the explosion of new frameworks, we struggle not to scratch our refactoring itch.Our industry sure celebrates the new, hip and "latest" across the board. As a business owner, however, I've had to embrace a drabber reality:Successful startups inevitably end up with "boring" tech stacks.Eventually, I explained the ins and outs of this statement to the dev who suggested a React refactor of our web app. Today, however, I want to address this issue in a more structured format.In this post, I'll discuss:How to choose a technology stack for your startup's web appWhy successful businesses end up with "old" tech stacksWhy resisting the urge to refactor makes business senseWhen and how you should refactor your web applicationI'll use our own story at Snipcart to illustrate my thoughts, coupled with actionable insights.Pre-startup daysBefore launching Snipcart, I was leading web development in a cool Québec City web shop. I did mostly client work. The fun part? Trying out new technologies in real life projects. My bosses trusted their engineers, so each project launch meant the opportunity to try fresh stacks. I mostly orbited around the .NET stack, building my first project with ASP.NET MVC (in beta), and another using Nancy, an awesome open source web framework in .NET.A couple years flew by. As my hairline began receding, I knew I needed a change from client work. I wanted to focus on a product. Fellow entrepreneurs inspired me. I knew my experimentation scope would narrow, but I was ready for new challenges. Truly scaling a project, for instance. It may sound buzzwordy, but back then I hadn't had the chance to design a system capable of handling hundreds thousands of simultaneous requests. I decided Snipcart would be that system and began exploring my tech stack options.Choosing your startup's tech stackSay you've gone through your genius "aha" moment, lean canvas & piles of wire-framing. Like every other fledgling startup, you reach the crucial crossroads that is picking your tech stack.Before giving in to the array of shiny logos, blog posts and GitHub stars trying to lure you into The Coolness, take heed of the following advice:1. Pick a technology you're comfortable withThis one's simple, really: do not mess around with stuff you don't already know. Point blank. Keep the glossy new JS frameworks for your 14th personal site/side project, unless you're just shooting for a proof of concept. If you want to build something serious, go for familiarity. Doesn't matter if it's old, boring, uncool, etc. There's no one best technology stack for web applications.In 2013, when I started working on Snipcart, I chose .NET for the backend. Why? Because I enjoyed working in C# and it was the stack I was the most efficient with. I knew It'd allow me to craft something solid.As for the frontend, we picked Backbone. SPAs were relatively new to me, and a colleague had already shipped decent projects with it. Back then (jeez I sound old), options were way more limited. Knockout, Angular, Ember & Backbone were the big players. I had no particularly fond memories of my time with Angular, so I cast it aside.Backbone, on the other hand, was more of a pattern than a framework to me. Sure, you had boilerplate to put together, but after that, it was easy to build on top of it.2. Pick tech stacks supported by strong communitiesIf you're the only developer kicking off the project, this is critical advice. A day will come when you're alone in the dark, staring in utter despair at one senseless error code. When that day comes, you don't want to be roaming through ghost forums and silent chat rooms, believe me.The cool, beta three-month-old framework might not have a rich help structure around it. That's another plus for picking "boring" techs: LOTS of girls and guys have struggled and shipped with them over the years. Like it or not, but documentation and help abound in the ASP.NET realm. ;)3. Make sure your web app stack scalesThe most important scaling choice to make isn't just about how many potential requests you'll handle. By picking a stack you understand, you'll be able to design an application that's easy to build upon. Keep in mind that you won't always be the only one navigating through the codebase. If you're successful, new, different people will be working in the code.So remember:A good tech stack is one that scales faster than the people required to maintain it. [source]In the beginning, I didn't really bother with scaling issues. I was too excited to just ship my own product. So I developed Snipcart the way I would've coded client projects (mistake): a single database & a web app containing everything. Truth is I never expected it to grow as it did. It didn't occur to me that our database could be the single point of failure in our project. I had never encountered such wonderful problems in client projects. So yes, I wish I had thought about scaling earlier! However, refactoring our architecture wasn't too painful since: we had picked technologies we were comfortable with. :)4. Consider hiring pros & consThis one's kind of a double-edged sword.On the one hand, picking a more "traditional" stack will grant you access to a wider basin of qualified developers. On the other, picking cutting edge technologies might attract new, killer talent.Needless to say, I tend to lean towards the former! In startup mode, you can't afford to hire an employee who needs months of ramping up to use a fringe framework. If you plan on quickly scaling the team, this is a key consideration. With Snipcart for instance, most developers fresh out of school had already worked with .NET. This definitely helped for our first hire.However, I'll admit that having a "boring" stack can work against you.For our second hire, .NET put us at a disadvantage: we had found the perfect candidate, who, in the end, decided that our MS stack was a no-go for him. At this point, my tech stack choice cost us a potentially great addition to the team.Like I said, double-edged sword.(Luckily for us, we found a new developer not long ago with solid .NET experience, and he enjoys working with us thus far!)See our SaaS' technology stack on StackShare.Success & sticking to your tech stackLet's fast forward on all the hard work it actually takes to make it and pretend you just did. You blazed through product/market fit, breakeven point, and started generating profits. Your Stripe dashboard finally looks appealing.You're "successful" now. And that probably means:You've been working your ass off for a while--there's no such thing as overnight success.You've been constantly shipping code with the tools you initially chose--and some aren't cool anymore.You've got real, paying users using your platform--read: SUPPORT & MAINTENANCE.See, when you scale, new constraints emerge. Support slows development velocity. Revenue growth means new hires (more training & management) + new expenditures (salaries, marketing, hosting). Profitability becomes an operational challenge.You're accountable to clients, employees and sometimes investors who all depend on your sustained success. As business imperatives trump technical concerns, your priority becomes crystal clear: keeping the company in business. And guess what? Spending hours of time on refactoring your frontend with the latest framework probably won't help you do that.The real cost of refactoring is time not spent fixing bugs, shipping features, helping customers, and nurturing leads. These are the things that'll keep you in business.So the real challenge becomes learning to deal with the technical decisions you've made to get here. Most times, the simple answer is to stick to your stack and focus on the business. Yes, your web application's code may look "old." But you're not alone: big, successful products still run old technologies!Take us for instance: we're still using tech that we could label "old." Backbone is still the "backbone" of our frontend application. No, it's not the coolest JS framework available. However, it works just fine, and a full rewrite would put an insanely costly pressure on operations.Don't get me wrong: I'm not suggesting you avoid refactoring at all cost. Products must evolve, but should do so inside the tight frame of business imperatives. Which brings us to our next point.When does refactoring your web app make sense?Refactoring is part of a healthy dev process and sure brings important benefits: sexier stacks for hiring, better code maintainability, increased app performance for users, etc.As long as refactoring doesn't negatively impact the business, I'm all for it. Like I said, products must also evolve. Just recently, for instance, we began shifting our frontend development to a more powerful framework, Vue.js.What we're doing, though, is progressive refactoring. Tools like Vue are perfect for that: they let you introduce a new tech in your stack without forcing you to throw away existing code. This incremental approach to refactoring has proven successful for us thus far--we did something similar a few years ago when we moved from RequireJS to Webpack. Progressive refactoring is, overall, more costly in development time than a full re-write. However, it doesn't stall business operations, which must remain a priority.When NOT refactoring ends up negatively affecting the business, then you should start considering it more seriously. A few important "time to refactor" flags to lookout for:Parts of the code become impossibly messy or hard to maintainTechnical debt begins manifesting itself through increased support requests & churn rateDeployment, testing & bug fixing are taking longer than they shouldNew developers' time-to-autonomy (shipping in production) escalatesFinding qualified developers to work on your app becomes arduousMaintaining the architecture becomes ridiculously expensiveNote how "let's try a new stack!" and "that code isn't clean enough!" aren't listed here. Or, as Dan McKinley puts it:One of the most worthwhile exercises I recommend here is to consider how you would solve your immediate problem without adding anything new. First, posing this question should detect the situation where the "problem" is that someone really wants to use the technology. If that is the case, you should immediately abort.Technology for its own sake is snake oil.This killer StackExchange answer lists even more refactoring flags you should be sensitive to.BONUS: Where to use all these new technologiesA desire to play with shiny new toys is only natural. It comes with the active curiosity residing in any good developer. At Snipcart, every dev does lots of self-learning. Like many others, we read blogs and try to keep up with latest trends. Of course, we can't use most of these up-and-coming tools in our core project. However, we run a developer-centric blog that covers all sorts of dev topics and tools. For us, this is a perfect playing field for experimentations. It allows us to quench our thirst for novelty, offers value to our community, all without compromising our "money" product!For startuppers, there are a few other areas where using hip tech makes sense:Marketing side-projectsInternal tools (analytics, comms, management, etc.)Marketing website / blogThese are all potent areas where you can experiment and learn new skills and stacks. And they will all benefit your core business. So find the one that works for you!Takeaways & closing thoughtsOuff, long post, heh? Before going back to my startup life, I'd like to leave you with the key takeaways here:Technical decision-making isn't just about technologies--it's mostly about the business.When picking a tech stack, consider: familiarity, community, hiring, scalability.Try as much as possible to adopt a progressive approach to refactoring your stack.Keep an eye out for relevant refactoring flags: development deceleration, talent scarcity, customer frustration.And finally: remember that the best technology stack for startups is your own grey matter. At the end of the day, architecture decisions & craftsmanship will eclipse tech choices.Explore startups & SaaS technology stacks examples on StackShare.io.Originally published on Snipcart's blog.
0 notes
philipholt · 6 years ago
Text
The open source Carter Community Project adds opinionated elegance to ASP.NET Core routing
I blogged about NancyFX 6 years ago and since then lots of ASP.NET open source frameworks that build upon - and improve! - web development on .NET have become popular.
There's more than one way to serve and angle bracket (or curly brace) my friends!
Jonathan Channon and the Carter Community (JC was a core Nancy contributor as well) have been making a thin layer of extension methods and conventions on top of ASP.NET Core to make URL routing "more elegant." Carter adds and formalizes a more opinionated framework and also adds direct support for the amazing FluentValidation.
One of the best things about ASP.NET Core is its extensibility model and Carter takes full advantage of that. Carter is ASP.NET.
You can add Carter to your existing ASP.NET Core app by just "dotnet add package carter" and adding it to your Startup.cs:
public class Startup { public void ConfigureServices(IServiceCollection services) { services.AddCarter(); } public void Configure(IApplicationBuilder app) { app.UseRouting(); app.UseEndpoints(builder => builder.MapCarter()); } }
At this point you can make a quick "microservice" - in this case just handle an HTTP GET - in almost no code, and it's super clear to read:
public class HomeModule : CarterModule { public HomeModule() { Get("/", async (req, res) => await res.WriteAsync("Hello from Carter!")); } }
Or you can add Carter as a template so you can later "dotnet new carter." Start by adding the Carter Template with "dotnet new -i CarterTemplate" and now you can make a new boilerplate starter app anytime.
There's a lot of great sample code on the Carter Community GitHub. Head over to https://github.com/CarterCommunity/Carter/tree/master/samples and give them more Stars!
Carter can also cleanly integrate with your existing ASP.NET apps because, again, it's extensions and improvements on top of ASP.NET. Now how you can add Carter to a ASP.NET Core app that's using Controllers in the MVC pattern just like this:
public void Configure(IApplicationBuilder app) { app.UseRouting(); app.UseEndpoints(builder => { builder.MapDefaultControllerRoute(); builder.MapCarter(); }); }
Then easily handle a GET by returning a list of things as JSON like this:
this.Get<GetActors>("/actors", async (req, res) => { var people = actorProvider.Get(); await res.AsJson(people); });
  Again, check out Carter on GitHub at and follow https://twitter.com/CarterLibs on Twitter!
Sponsor: Like C#? We do too! That’s why we've developed a fast, smart, cross-platform .NET IDE which gives you even more coding power. Clever code analysis, rich code completion, instant search and navigation, an advanced debugger... With JetBrains Rider, everything you need is at your fingertips. Code C# at the speed of thought on Linux, Mac, or Windows. Try JetBrains Rider today!
© 2019 Scott Hanselman. All rights reserved.
Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media
      The open source Carter Community Project adds opinionated elegance to ASP.NET Core routing published first on http://7elementswd.tumblr.com/
0 notes
suzanneshannon · 6 years ago
Text
The open source Carter Community Project adds opinionated elegance to ASP.NET Core routing
I blogged about NancyFX 6 years ago and since then lots of ASP.NET open source frameworks that build upon - and improve! - web development on .NET have become popular.
There's more than one way to serve and angle bracket (or curly brace) my friends!
Jonathan Channon and the Carter Community (JC was a core Nancy contributor as well) have been making a thin layer of extension methods and conventions on top of ASP.NET Core to make URL routing "more elegant." Carter adds and formalizes a more opinionated framework and also adds direct support for the amazing FluentValidation.
One of the best things about ASP.NET Core is its extensibility model and Carter takes full advantage of that. Carter is ASP.NET.
You can add Carter to your existing ASP.NET Core app by just "dotnet add package carter" and adding it to your Startup.cs:
public class Startup { public void ConfigureServices(IServiceCollection services) { services.AddCarter(); } public void Configure(IApplicationBuilder app) { app.UseRouting(); app.UseEndpoints(builder => builder.MapCarter()); } }
At this point you can make a quick "microservice" - in this case just handle an HTTP GET - in almost no code, and it's super clear to read:
public class HomeModule : CarterModule { public HomeModule() { Get("/", async (req, res) => await res.WriteAsync("Hello from Carter!")); } }
Or you can add Carter as a template so you can later "dotnet new carter." Start by adding the Carter Template with "dotnet new -i CarterTemplate" and now you can make a new boilerplate starter app anytime.
There's a lot of great sample code on the Carter Community GitHub. Head over to https://github.com/CarterCommunity/Carter/tree/master/samples and give them more Stars!
Carter can also cleanly integrate with your existing ASP.NET apps because, again, it's extensions and improvements on top of ASP.NET. Now how you can add Carter to a ASP.NET Core app that's using Controllers in the MVC pattern just like this:
public void Configure(IApplicationBuilder app) { app.UseRouting(); app.UseEndpoints(builder => { builder.MapDefaultControllerRoute(); builder.MapCarter(); }); }
Then easily handle a GET by returning a list of things as JSON like this:
this.Get<GetActors>("/actors", async (req, res) => { var people = actorProvider.Get(); await res.AsJson(people); });
  Again, check out Carter on GitHub at and follow https://twitter.com/CarterLibs on Twitter!
Sponsor: Like C#? We do too! That’s why we've developed a fast, smart, cross-platform .NET IDE which gives you even more coding power. Clever code analysis, rich code completion, instant search and navigation, an advanced debugger... With JetBrains Rider, everything you need is at your fingertips. Code C# at the speed of thought on Linux, Mac, or Windows. Try JetBrains Rider today!
© 2019 Scott Hanselman. All rights reserved.
Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media
      The open source Carter Community Project adds opinionated elegance to ASP.NET Core routing published first on https://deskbysnafu.tumblr.com/
0 notes
concettolabs · 7 years ago
Text
What is ASP.NET boilerplate framework?
Coming with a new enterprise of a web application is a tough task. Knowing that all the applications require some tasks in common, we often end up repeating ourselves. Today we can see many companies coming with their own libraries or application frameworks to accomplish these common tasks without repeating the common tasks. However, there are still some companies which copy certain parts of prevailing applications and build stat point for a new application.
Well, the first approach mentioned here is undoubtedly good and developing if your organization is big and has sufficient time to work on such frameworks.
Ever wondered, what if you can share more and repeat less? Imagine if instead of per company or per project, the DRY principle gets universally implemented. I accept that it sounds naïve but there should be a starting point.
DO YOU KNOW ABOUT ASP.NET BOILERPLATE FRAMEWORK?
Well, for those of you who don’t know, ASP.NET boilerplate framework is considered as the beginning of new modern day web applications. The ASP.NET web application framework is aimed to be a general purpose framework and a project model.
The web application framework makes use of familiar tools and implements best measures to avail you a SOLID development experience.
To understand what it does, let us understand the server-side and client-side individually.
Client Side
It avails project templates for multi-page Applications and Single-page applications.
The javascript libraries that are used often are configured and included by default.
It also has distinct APIs for certain common tasks like showing notifications and alerts, making AJAX requests, blocking UI etc.
By using dynamic Web API layer it creates dynamics javascript proxies. The same eventually call applications services with ease.
Server Side
It is based on the new Web API and ASP.NET MVC.
Flawlessly implements Domain Driven Design and layered architecture.
It also provides you space to develop compostable & reusable modules.
It implements & supports database migrations3
WOULD YOU LIKE TO HIRE ASP.NET DEVELOPER
A CONCLUSION OF AN ASP.NET BOILERPLATE FRAMEWORK
The ASP.NET Web Application Framework comes with base interfaces, classes, and tools that give you ease in building large-scale applications. However, as it is said, nothing comes with all doom and all bloom. There’s a bit of each. Before you go with it, we just want you to know that it isn’t one of Rapid Application Development (RAD) tools which give you an infrastructure to develop applications without using codes.
Also, it isn’t a code generation tool. But yes, it comes with numerous other features that develop codes at run-time. Having said these, we just want to clarify that this impeccable framework isn’t an all-in-one offering of technology. However, the areas it serves, it is best for them. Few of the renowned tools that it uses include Castle Windsor as DI Container, Log4Net for logging, AngularJs for SPA framework and more.
Originally Published by Concetto Labs > What is ASP.NET boilerplate framework?
0 notes