https://stackoverflow.com/questions/32780315/could-not-find-a-part-of-the-path-bin-roslyn-csc-exe
Tag: DotNet
.NET: How To Use ViewData, ViewBag And TempData in MVC
ViewData
It is a dictionary which can contain key-value pairs where each key must be string. We can use it in transferring data from Controller to View. We can only transfer data from Controller to view but if we wish to pass data back again to controller then it is not possible. So it is valid only for the current request.
ViewBag
ViewBag is also similar to ViewData. It is used to transfer data from Controller to View. It is a type of Dynamic object, that means you can add new fields to viewbag dynamically and access these fields in the View. You need to initialize the object of viewbag at the time of creating new fields.
TempData
TempData is a dictionary object derived from TempDataDictionary. It is for subsequent HTTP requests; unlike ViewBag and ViewData, those stay only for current request. It can be used to maintain data between controller actions as well as redirects.
REFERENCES:
.NET: What Version Is On the Target Server
I’m upgrading .NET (legacy 4.*) applications on multiple unfamiliar servers. This includes needing to know if the currently installed framework meets my requirements. Instead of fumbling through the actual registry, I can pasted this C# snippet into a console app and all is good:
Post-Mortem: Using the Repository Pattern With Entity Framework
Dear all future developers who may get stuck dealing with a couple of applications I’ve written over the past year or so. I know that much future cursing at me is on the way. Much to my regret, I confess I used repositories with Entity Framework Code-First.
…and I didn’t just use one or two, I added at least four or five — on top of a BASE repository. To make it worse, I even created a BaseController to deal with all this so that now I have inheriting controllers that have to deal with ramifications.
The severity of the above could have been significantly reduced if I had written proper unit tests. In one app, I actually DID write (improper — with very little mocking) unit tests first but because the tests now need to run on an independent build server, I have to suffer to re-write them quickly to meet a deadline but, the reality is, the apps need re-architecture.
I’m working on a prototype with better architecture but that will probably not have time to go through the the whole integration testings, etc.
Thanks @hoagieland for your post. It might be a little extreme but with many valid points.
All who have to deal with this particular flavor should read:
You’re All Doing Entity Framework Wrong
.NET Framework vs .NET Core vs .NET Standard ?!?
I think get a grip on the latest trends only to learn that I’m still steps behind. Thanks to Immo Landwerth for this clear article and cool tricks. It’s ten months old but new to me. 😑
.NET Standard – Demystifying .NET Core and .NET Standard
“NET Standard is a specification. Each .NET Standard version defines the set of APIs that all .NET implementations must provide to conform to that version. You can think of it as yet-another .NET stack, except that you can’t build apps for it, only libraries. It’s the .NET implementation you should use for libraries that you want to reference from everywhere.”
Implementations
|
OS
|
Open Source
|
Purpose
|
.NET Framework
|
Windows
|
No
|
Used for building Windows desktop
applications
and ASP.NET Web apps running on IIS.
|
.NET Core
|
Windows, Linux, macOS
|
Yes
|
Used for building cross-platform console
apps
and ASP.NET Core Web apps and cloud
services. |
Xamarin
|
iOS, Android, macOS
|
Yes
|
Used for building mobile applications for
iOS
and Android, as well as desktop apps for
macOS. |
.NET Standard
|
N/A
|
Yes
|
Used for building libraries that can be
referenced
from all .NET implementations, such as
.NET Framework, .NET Core and Xamarin.
|