Building Simple API Gateways with Ocelot and ASP.net Core
https://ift.tt/2PWxe2y Building Simple API Gateways with Ocelot and ASP.net Core Click here
.status-msg-wrap { display: none; }
Hey everyone,
What’s the best way to remap submitted options values from a listbox in the post action, back to a list it was chosen from.
The only way I can think of doing it is by reacquiring the list of options from the datasource, then using LINQ to get the selected items, but that requires a additional sql call.
Is there another way to do it without making a call to the db?
Thanks.
http://bravesquire.com/2018/07/making-a-serialization-system-in-cshap/
I recently published a blog post about the making of a serialization system for use in a game. I would love to hear what you think and if you have any suggestions about how to make it better.
It's showing an old version of the app that I'd previously published, and it's failing to connect to the database. I didn't get any errors when publishing. The files such as site.css are up to date on the filesystem but they're not appearing in my browser properly, and the database connection is broken. I tried clearing my cache to no avail. What happened? How can I get the latest version of my app running under IIS?
The SOLID Design principles represent five design principles that basically used to make the software designs more understandable, flexible and maintainable.
The theory of SOLID principles first introduced by Robert C. Martin. In this article, I will discuss the basics of SOLID Design Principles.
The SOLID Design principles are the design principles that enable us to manage most of the software design problems that generally as a developer we face in our day to day programming. These design principles are provided with some mechanism to make software designs more understandable, flexible and maintainable.
Let’s first discuss the reason behind most of the unsuccessful application.
Developers start designing and developing the applications with their tidy design knowledge and experience. But over the time, the applications might give bugs. Them the developer needs to alter the design for every change request or for any new feature request to include.
After some time we might need to put a lot of effort, even for simple tasks and it might require a full working knowledge of the entire system. But we can’t blame change or new feature requests as they are part of the software development.
We can’t stop them and refuse them either. So who is the culprit here? Obviously, it is the design of the application.
The following are the reasons that cause the damage to the software.
The Solid single responsibility principle states that
“every module or class should have responsibility for a single part of the functionality provided by the software, and that responsibility should be entirely encapsulated by the class”.
Robert C. Martin expresses the principle as, “A class should have only one reason to change”.
The Open Closed Principle states that
“software entities such as classes, modules, functions, etc. should be open for extension, but closed for modification”.
That is, an entity can enable its behavior to be extended without altering its source code.
Liskov Substitution Principle is a Substitutability principle which state that, if S is a subtype of T, then objects of type T should be replaced with objects of type S (that means objects in a program should be replaceable with instances of their sub-types) without altering any of the desirable properties of the program (correctness, task performed, etc.).
In simple word, we can say that If a program module is using a Base class, then the reference to the Base class can be replaced with a Derived class without affecting the functionality of the program module
The interface segregation principle (ISP) states that no class should be forced to implements any methods it does not use. ISP splits interfaces that are very large into smaller and more specific ones so that clients will only have to know about the methods that are of interest to them.
That means the main responsibility of ISP is to keep a system more decoupled and thus easier to refactor, change, and redeploy.
The dependency inversion principle (DIP) states that
In simple word, we can say that while designing the interaction between a high-level module and a low-level module, the interaction should be thought of as an abstract interaction between them.
Following are the Links where I explained each of these principles in a great details with taking some real-time examples.
Single Responsibility Principle
https://dotnettutorials.net/lesson/single-responsibility-principle/
Open Closed Principle
https://dotnettutorials.net/lesson/open-closed-principle/
Liskov Substitution Principle
https://dotnettutorials.net/lesson/liskov-substitution-principle/
Interface Segregation Principle
https://dotnettutorials.net/lesson/interface-segregation-principle/
Dependency Inversion Principle
https://dotnettutorials.net/lesson/dependency-inversion-principle/
I'm new to Razor Pages and Identity and can't find out how i print out all usernames on a page. I get that in the page i probably write something like @model.username, but i can't figure out what to write in the PageModel.
I'm using .net core 2.0
Are you guys excited about WebAssembly and do you think its going to be a thing in the future ? Do you believe in the claims of better performance and that we can code with any language in it etc like it could replace Javascript and we could code it in C#, C/C++, Java etc ?
Hello!
This is a x-post in StackOverflow. Forgive me if this breaks etiquette. I'm a lurker on the internet, so contributing like this is a little foreign to me. I had to break the silence because this issue has thrown me for a loop for a few days now.
I'm fairly new to programming and I'm trying to create a website to house the web apps I build. I currently have a model, view, and controller to project the contents of my Apps table. These apps are hosted elsewhere, so the tiles that appear in the screenshot below simply link out to other locations. I'd like to include a way to display recently used apps in a drawer, (the code housed in the _Layout).
_Layout Drawer:
App View with _Layout (navbar and drawer)
I'd like to start by displaying ANY model data in the _Layout drawer. If I simply throw my Apps View code into the _Layout, like so:
Layout (partial code, I left out irrelevant parts):
@_Layout, located beneath navbar code and above RenderBody()@ @model IEnumerable<Apps> <div id="footerSlideContainer"> <div id="footerSlideButton"></div> <div id="footerSlideContent"> <div id="footerSlideText"> <div class="parenttile"> @foreach (var Apps in Model) { <a href="http://@Apps.AppLink" target="_blank"> <div class="tile"> <div></div> <div class="tilemid"> <div></div> <div> <img class="tileimage" src="@Apps.AppImage" alt="@Apps.AppName" /> </div> <div></div> </div> <div class="tilebot"> @Apps.AppName </div> </div> </a> } </div> <h3>Recently Used Apps</h3> <p>This section will store all of your most recently used apps. It stays on the screen until you click the drawer icon.</p> </div> </div> </div>
...I get the following error in Debug on the @foreach line: NullReferenceException: Object reference not set to an instance of an object. .net core. I researched that error here: What is a NullException error and how do I fix it?
Which of these solutions would work/work best?
Then there's the issue of creating the favorites. I think that's a bit more straightforward, as this Display recently viewed items contains all the info I think I need.
Thanks for any help - I'm including my model and controller code below:
Model:
public class Apps { public int AppID { get; set; } public string AppName { get; set; } public string AdGroup { get; set; } public string AppDescription { get; set; } public string AppLink { get; set; } public string AppImage { get; set; } }
Controller: (using hard coded, dummy data for now, before I move to db)
public class AppsController : Controller { private List<Apps> _apps; public AppsController() { _apps = new List<Apps>(); //creating test Apps model _apps.Add(new Apps { AppID = 1, AppName = "Test App 1", AdGroup = "Group 1", AppDescription = "First test app.", AppLink = "www.google.com", AppImage = "/images/image1.png" }); //et al } public IActionResult Index() { return View(_apps); } }
I have one for a Discord bot I'm running, one for an ASP.NET Core app I'm trying to debug, and another one for Xintis knows what... How do I know which one is which besides guessing?
I am actively working on a Microservice, the mistake we did is we did not write tests. Only thing we have to test our web API is JSON payloads saved in Postman.
Given the state we are in what will be your suggestion? Can JSON payloads utilized for testing API controllers? Should I invest time in Postman automation?
Microservice is developed with Hexagonal architecture.
Feel free to ask question.
I am working on a company with ASP.NET MVC using .NET Framework but I was wondering to start learning .NET Core for my private projects. I was just wondering how much design and implementation difference is there between these two.
We're running a combination of Windows 10 1609 or 1703 and rolling out windows 10 1709 to all developer systems. We've hit a snag where after the upgrade, running the debugger causes an error code of 403.14 forbidden; the suggestions are to enable directory browsing but that's not really the fix we're after. If we starting with a clean W10 1709 and install all of our development tools, this isn't an issue.
We've repaired the VS installation, re-installed IIS Express but neither seems to do the trick. As a test, we also enabled all the optional IIS features for application and that seems to fix it, but ultimately we'd like to figure out what's causing the problem.
Our environment is Visual Studio 2017, MVC 4, C#7 .NET 4.7.2.
Has anyone else experienced this problem?
So I'm studying for the mta Software Fundamentals exam on Sep 6. I'm looking at practice exams online but I don't trust that they're giving me correct info. Here's an example - The question is as follows:
You are designing a class for an application. You need to restrict the availability of the member variable accessCount to the base class and to any classes that are derived from the base class. Which access modifier should you use? A. Internal B. Protected C. Private D. Public
Now my answer is B. But the exam claims it's C, private. This is obviously wrong, right? Now I don't know if I can trust the exam at all. And this isn't the only one. I took an exam on techveze and they had multiple wrong answers. I'll have to post some of those one day. I'm just worried that I can't trust any of these practice exams. Does anyone know of any trustworthy ones? Or am I just arrogant and am actually picking the wrong answer?
Hello Everyone,
I'm kind of new to Akka.Net programming, Can anyone point me some kind of web app solution which is available online which uses akka.net. Currently, i'm using hangfire, I'm wondering what is the difference between akka.net and hangfire.
Hi guys.
I'm a full time laravel developer, 3 months out of college, and I'm looking to switch to C# and dot net. I'm in Dublin Ireland, and the majority of quality jobs seem to use C# and Java with a frontend javascript framework. So it's time to bite the bullet and learn one.
I've worked with C# and MVC5 previously I'm college and enjoyed it, but I never stuck with it. I'm looking for resources and guides on learning Web dev with this technologies.
I have a few questions.
Is Mosh Hamedani on Udemy a good resource?
Is there a Laracasts equivalent?
Who would be the best twitter accounts to follow?
Can I use MVC5 on a mac. I know core is out, and cross platform, but a lot of the jobs in Dublin are still MVC5.
Thanks.
Hi community,
I am currently in the process of migrating a substantial vb6 project towards vb.net. This project has a number of referenced dependencies, custom controls and components - essentially additional functionality found in other vb6 projects hooked up to the main project.
After having used the default migration tool in Visual Studio 2008, I’ve noticed that these are now treated as COM objects, unaltered and referenced by the converted project.
My understanding here is that Visual Studio is applying a “.net wrapper” or interpreter to these projects, under a technique known as interoperability. Interoperability allows us to integrate the old with the new in order to run external components not written in a .Net language attached as project references.
Many thanks in advance!
We are making a site in Razor Pages using .NET Core 2.1 and are using code first EF Core, dependency injection and iDesign and all the cool conventional ideals. We started it half a year ago and are still working on it. The database it pulls from is small; 5 or 6 columns averaging 10 or so entries per SQL call; about 10 tables. Our entire site is only around 30 MB.
As I try to test it, it takes over a minute after the project built to show up on the screen and each page I click on just has to load a table or a 8ish field form and it takes anywhere from 30 seconds to a minute after the click to load while debugging. I try to do some of the SQL statements it does to see if its just bad indexes but those all finish in well under a second. We have refactored and refactored to the point where we are over budget. It is a basic CRUD site that will need to utilize multiple page loads and while its not incredibly slow on the servers it is quite a few seconds from when you click on a link to when it loads, maybe 10 or so... basically a lifetime in internet time.
So as many of you know, in Chrome you can load a page and it would tell you how long different steps take and with that you can see what thing took a long time and eliminate it. Is there anything like that for .NET Core? I don't know if there is some sort of tracer we can have running on the backend that will tell us what our slow point is. I know Azure has some tools but we are just running this on servers my company manages.
I am creating an API which the app I am developing will utilise. This app will be like a social network, and have various sections to it (Login, Posts, Messages, Friends, etc). This is my first time developing an api to work alongside an app, so I wanted some guidance.
Is it better practice to have a controller for each of these sections (LoginController, MessageController, etc). Or am I better off making seperate APIs for each section (Login API, Messaging API). I suspect each section will contain around 10-15 endpoints.
My friend Ibrahim just posted a quick tutorial on building a basic CRUD app with ASP.NET Core and Vue.
https://developer.okta.com/blog/2018/08/27/build-crud-app-vuejs-netcore
why all the web hosting companies are not supporting the "asp.net core" deployment on shared hosting. They suggest to go for windows VPS to deploy asp.net core project.
Is there any alternate to host asp.net core in any cheap server?