As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Can you advise me an a resource with simple C# LINQ/lambda-expressions code exercises?
Desirable but not obligatory: online, free, with answers, step by step, the simplest and fast, to study the syntax but not complicated puzzles or world problems.
I do not think it is duplicated with
Learning C# with exercises, questions and puzzles
since it was 2+ years ago, so propably outdated, and it did not contain any good reference (looked through all of them).
The best google search result I managed to find is:
C# exercises and solutions-C# variables and data types
though I am not satisfied.
Update:
Something similar to LINQ Quiz which is for me the best reference I could find to this moment.
A very good ressource for LINQ is Jon Skeet's blog "Reimplementing LINQ to Objects".
He reimplements the whole LINQ functionality step by step giving excellent insights about the inner workings.
Reimplementing LINQ to Objects
This is not a tutorial of such but I've found it very usefull for the linq side of things...
http://code.msdn.microsoft.com/101-LINQ-Samples-3fb9811b
Related
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I am making a program in C# with a lot of IO operations.
Some of that operations are copying directories.
I was really stunned when I figured out that you don't have something like Directory.copy(SourceDir, DestinationDir) in C#.
I googled a little bit around and at msdn they give a code sample to copy directories.
(http://msdn.microsoft.com/en-us/library/bb762914.aspx).
But when you search a little bit further, there is a Directory.Copy method in the Microsoft.VisualBasic.FileIO namespace.
(http://msdn.microsoft.com/en-us/library/ms127957.aspx)
I could refere to this namespace and use this method, but there must be a reason why Microsoft does not support this in C# and why they aren't mentioning it on msdn.
Hope somebody can tell me the reason.
I can write extensionmethod to solve this problem & I can solve it pretty easy, but my question is Why? Why is there no such method in C#, I just want to know :-)
Because it's easy enough to do a foreach on a DirectoryInfo.GetFiles(), while also giving you an opportunity to filter the list of files being copied, or do some other operation besides copying.
If it really bothers you, write an extension method for the DirectoryInfo class, or a FileInfo[] collection.
My guess is that VB is oriented more on beginners and things like Microsoft.VisualBasic.FileIO were intended to attract them to .NET world.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I come from a Java background and am getting more into .NET, what are some good libraries to use in my DAO layers? I'm used to using MyBatis (this appears to exist but not in a real full release). I've used Hibernate, which apparently exists in .NET but I'd rather avoid a full POJO style object mapper. I'd really like a library that is query based like MyBatis. Does anyone have some suggestions?
I really like the latest entity framework by microsoft: http://msdn.microsoft.com/en-us/data/ef.aspx. They've made great progress with it.
Use the one that StackOverflow is using. Dapper.NET
NHibernate in .Net can be very nice with Linq to NHibernate. While the setup can be tedious, I still think I like NHibernate more than Hibernate. (Be it because of C# vs Java is a debate)
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
College student about to major in CS. Just want to know if it really matter what language you learn first?
Seems to me CS and the nature of our work is about problem solving. Different language seems to differ in syntax, libraries you can use, etc. etc. But when it comes down to it, if you know how to solve a particular problem in one language, you could do it in other languages as well right? I mean surely some languages are better tools and can do a more elegant job, but at the end of the day the ideas are still the same right?
It doesn't matter what language you use. The algorithm underneath is the main thing that matters.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Is there a feature equivalent to C#'s regions for being able to group code into named blocks and collapse and expand them?
Alternatively, are there any workarounds or third party tools available to achieve the same result?
One possible workaround might be using F# Outlining VS Extension that provides //#region outlining functionality. I use it with VS2010 for couple of months without any problems and find it very convenient:
[-]//#region Region Name
--lines of F# code--
--lines of F# code--
--lines of F# code--
//#endregion
with one click collapses to
[+]Region Name
and back.
I found times ago (out of mine curiosity) the link the was searching on for asking this question.
If you look at Regions and navigation bar for F# in Visual Studio the guy seems implemented an experimental feature. Post of firsts of 2012, so it's pretty fresh stuff.
Should say that I didn't try it till now.
Good luck.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I have heard a lot about anti patterns and would like to read a book on this,which book would you suggest for Anti patterns.
There actually is a book called AntiPatterns. The supporting website includes a good overview of its contents, so you can decide whether it is worth buying. Find out more.
There is also this book specifically on sql anti patterns:
SQL Antipatterns: Avoiding the Pitfalls of Database Programming
by Bill Karwin
Read more at
http://pragprog.com/titles/bksqla/sql-antipatterns
The Daily WTF is always a good place to find some choice examples of antipatterns.
Anti-Patterns
Bug Patterns In Java