What editor are you using? ...in visual studio you would have warnings .e.g CS4014 which implies that the processing order is not guaranteed.
What are you trying to achieve; if we knew that; our advice would be far more helpful.
Extension Methods like ToBinary are defined in a static class; and you can identify it as an Extension Method because it uses the this keyword on the 1st parameter; which is the data type that you are extending with this dot (extension) method.
So for example; you can define it similar to this...
For further clarity here's an example to compute the headers (as a List) and similarly the binaries (as a List)
var path = "../groceriess.csv";
var rows = File.ReadAllLines(path).Select(s => s.Split(",").ToList());
var headers = rows
.SelectMany(s => s)
.Distinct()
.OrderBy(s => s)...
Quite possible...
My interpretation is as follows:
This for me implies that ALL distinct elements should be used for headers. No exclusions.
The second operation is then to compute binaries as you described.
It was never meant to be a complete solution... merely a pointer to the 1st challenge, namely:
All he'd have to do is to compute the distinct elements in the returned list; and he'd have his header.
The binary match up part is rather easy once you have your header...
...naturally for that...
Have you tried something along the lines of this?
Task.Factory
.StartNew(() => DataManagerRealTimeAgent.GetAgentData(selectedGroups))
.ContinueWith(t =>
App.Current.Dispatcher.BeginInvoke(new Action(() => {
RealTimeAgentData = t.Result;
})));
It's not an ASP.net problem.
I suggest you have a look at incorporating one of the many front end styling frameworks with ASP.net, for example:
Bootstrap
...and its many alternatives
...and then look at how they style multicolumn list layouts.
Your description is IMHO lacking some details:
What is the DB
Is it running on separate hardware; separate from UI.
How are you accessing the DB; e.g. SQL, SOAP, JSON, ...
Brief description of how the DB is updated; is this e.g. from the UI(s), or other...
Frequency of data updates; does the...
The code you shared is incomplete / laced with errors.
Its not clear what you're trying to accomplish.
I suggest you start by posting a working example of your code, and then describe what you're trying to accomplish with the Linq statement.
Agreed.
With templated html; its quite normal to break the task up into small bits that can be logically composed; how far the OP would need to take this is really going to depend on the extent of the level of customization differences amongst clients, for example:
CSS styling only would be...
I'm assuming it's ASP.Net related.
If so then read up on View Engines for ASP; more specifically on how to create templates for that. The simpler route would be to keep things as close to traditional HTML and CSS as possible; because then styling can be adjusted without recompilation.
Consider using $ string interpolation; it'll simplify your Writeline statements, for example:
Console.WriteLine($"The Information in {Textbox1.Text} is Correct!");
I suggest you learn to test your conclusions, for example, you state that "class initialization is also required for static methods... "
public class Test1 {
public static void DoesITWork() {
Console.WriteLine("Test1 worked");
}
}
public static class Test2 {
public static...
Class methods / instance methods are by themselves not initialized... because they are an inherent part of the class definition they require the class that contains them to be initialized before they can be used. Normally it's easy to spot an initialization of a class by the use of the new...
My bad... its an order of precedence problem.
The extension methods essentially do work as I indicated; however the order of precedence in C# makes it appear as if it doesn't. C#'s order of precedence internal rules stipulate that dot method calls are processed before prefix operators, so the...
Also int is an integral type and not a class type like string; so they originally. did not have any dot chained methods that you'd typically find for a class type like string; however since the addition of extension methods you can add this yourself to any type including integral types like...
Class methods
These methods operate on the internal properties of a class, and are only available for use after a class has been initialized. In this context; string is a class, and ToUpper is a method that accesses the internal stored string property value of the class and uses it to compute...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.