Click here to Skip to main content
15,347,963 members

Comments by Super Lloyd (Top 25 by date)

Super Lloyd 27-Sep-21 12:25pm View
for the record I try to implement

public class MyList<T> : IList<t>, IList

And it's very hard to implement IList.Add(object? o), I dunno if the current implementation supports null or not..
Super Lloyd 27-Sep-21 12:14pm View
nullable reference of course, is a new C# 9 feature.
Super Lloyd 31-Mar-19 20:18pm View
Indeed... I should have replied that to the "Solution 2 thread", ooopsie... just did it again! ;P
Super Lloyd 31-Mar-19 20:17pm View
No worries.. good luck! :)
Super Lloyd 30-Mar-19 23:47pm View
First, a useful link:

1. (long answer)
Alright, should I repeat my answer?
"The main difference between ASP.NET MVC and MVC Core is that the later is multiplatform and probably runs 1000x faster."

So yes, ASP.NET MVC (Which runs on the .NET Framework) have razor pages, in fact Razor page were created with the first release of ASP.NET MVC.
Page controller, or WebAPI controller, both available in ASP.NET MVC and MVC Core (did I mention that both API were similar?) both can specify what query they handle (GET/POST/PUT/DELETE)
WebAPI is "optimised" toward data payload (such as XML/JSON) and have a few quirk about it. And Page controller are optimized towards delivering HTML page and a few quirk towards that.

The web story with .NET: WebForm came first, Microsoft was hoping to make web development "as easy as WebForm" (ahem), then came MVC and (mostly) everybody loved it (after a while). But was slow because it was fitting in the WebForm pipeline and there was lot of wasteful code running. Then they made .NET Core and remade a cleaner version of MVC that runs better (1000 times!) with it. It's usage was mostly the same but they simplified many little tings about the API. But the general usage is very much the same.

Razor Page Controller are mostly to display page. WebAPI handle data request better. PageController can do both truly (HTML, Json, ..) but every now and then WebAPI handle dataquery a little bit better....

2. yes you can specify to handle GET/POST/PUT/DELETE

3. Entity Framework is somehow orthogonal. i.e. it doesn't matter for MVC web pages / web services whether your use EntityFramework to access some database or not.
But most people typically do it. Where else one would store heaps of live data?
Super Lloyd 14-Oct-16 19:44pm View
the problem is instead of having 2 table (historical locations of all trucks and current location of all trucks) I got only 1 table (historical) and try to get the current location of all trucks by fetching the latest record for each truck.

Yeah! I did make the index unique!
I can't cluster it since I have a primary key (ID) but.. that is an interesting idea!

A view (for current locations) hey? Excellent idea! :)
I wanted to avoid SP and dislike complicated view.. but this one is so meaningful and simple! Yeah! :)
Super Lloyd 16-Jul-16 5:11am View
Thanks, doing it... (in GitHub)
I could only find code for parameterless constructor, using NewObj opcode! :((
Super Lloyd 5-Jul-16 17:38pm View
You're welcome! :)
MVVM might seem confusing at first.. but it will become great once you understand it! :)
Don't other think it! ;)

Just think of it as MV (Model - View) the VM (ViewModel) is just a wrapper around the model to supplement it with change event and add property irrelevant to the Model, like public ICOmmand ClickCommand

And it make like really easy once you master it because:
1. there is (almost) enough support build-in XAML to make it happen relatively easy (you will have to add some helper code, such as the famous DelegateCommand)
2. separating UI and model "despaghettify" your code

Don't worry too much about big concept such as "separation of concern" the simplicity should become apparent quickly. if it's not after 1 or 2 project, give it up. It might help you understand! ;)
Super Lloyd 15-Feb-16 0:54am View
Awesome Mehdi!!
I was suffering of a severe case of Mondayitis!
It was my question and I ignored the answer!
The Nuget package fixed it!
It now compiles.... And even better, it runs! :)
Super Lloyd 14-Feb-16 23:11pm View
I think you didn't really read my question...
Have you noticed that I used the following application template:
"Templates > Visual C# > Web > Console Application (Package)"
It's a whole new thing .NET environment coming with ".NET Core RC1" for native apps.
Super Lloyd 14-Feb-16 20:16pm View
Sorry... didn't read your answer correctly (was confused by the answer I got on MSDN forums! ^_^ )

At any rate... Nice you found FileStream in corefx!!! :D
But.. it's still doesn't compile! :'(
See my error message in updated question!
Super Lloyd 14-Feb-16 19:53pm View
Forget "random" the question is could I use FileStream with DNXCore?

I got that error:
Program.cs(13,32,13,42): DNX Core 5.0 error CS0246: The type or namespace name 'FileStream' could not be found (are you missing a using directive or an assembly reference?)
Program.cs(13,61,13,69): DNX Core 5.0 error CS0103: The name 'FileMode' does not exist in the current context
Super Lloyd 4-Dec-15 20:50pm View
I tried UWP and WinRT Win8 project, but I keep running into error such as:

An unhandled exception of type 'System.TypeLoadException' occurred in WpfD3D11Interop.exe

Additional information: Could not find Windows Runtime type 'VisualizationComponent.Class1'.
with the InnerException message:

Types from custom Windows Runtime components are not supported in desktop applications.

That said I just remember my annoyance with C++ CLI is that it target a particular architecture (x86/x64/arm) and you can't ship (easily) multiple architecture together.
And that annoyance is not in any way improved by a native C++ component!
So there is no point for me to go through a complicated build process after all!
Super Lloyd 22-Sep-15 0:29am View
Interesting link, thanks! :)
Super Lloyd 21-Sep-15 20:58pm View
mmm... well Install-Package Bower did seem to do something successfully... (let's assume for a moment that Install-Package does the same work as npm... though I doubt it) but what about bower install react jquery?!
I tried (UNsuccesfully) Install-Package react ...
Super Lloyd 21-Sep-15 20:08pm View
mmm... I installed Web Essentials 2015 (just in case), then started an ASP.NET vNext web project, started the NuGet package manager console and selected that project (just to be really really sure!)

then I typed npm install -g http-server
And I got
npm : The term 'npm' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify
that the path is correct and try again.
At line:1 char:1
+ npm install -g http-server
+ ~~~
+ CategoryInfo : ObjectNotFound: (npm:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

I must be missing something...
Super Lloyd 23-Apr-15 1:38am View
Well, as per my question! ^_^ "I want to provide a Task based version (for command line test, without UI)"
Super Lloyd 22-Apr-15 23:20pm View
Well... when your View Model is used in a console application NOT linked with ANY of the WPF libraries / DLLs
Super Lloyd 22-Apr-15 23:03pm View
So how does your answer relate in any way in UI less testing context?!?!?!?
Super Lloyd 25-Nov-13 10:41am View
Hi, I solved it myself! ;)
Beside I have a type name parser and need to resolve each piece independently, to repair broken Type.GetType(), so I can't use the full type name as above!
Super Lloyd 21-Oct-13 21:59pm View
yeah basically I am looking for example where I can put it to good use!
Mapping field for the sake of doing it is counter productive!...
I thought of another use, when using .edmx, the EF class have no validation attribute, annoying. Intermediary class with validation attribute might the less cumbersome solution to that!
Super Lloyd 21-Oct-13 21:59pm View
yeah basically I am looking for example where I can put it to good use!
Mapping field for the sake of doing it is counter productive!...
I thought of another use, when using .edmx, the EF class have no validation attribute, annoying. Intermediary class with validation attribute might the less cumbersome solution to that!
Super Lloyd 21-Oct-13 20:20pm View
So.. I don't really need it.
It's just that *IF* I ever feel like I need a mapper, then I should use that one? Just as I thought! ^^
Super Lloyd 12-Sep-12 4:52am View
Ho this is a new C++/Cx thing, cool!
Thanks for this complete answer! :)
Super Lloyd 11-Sep-12 23:48pm View
I don't have windows 8 at work but....

I just checked the MSDN sample from (which I did compile and run at home):

In C++\DirectXBase.h:40 => "protected private:"
And it compiles and run!