C
C#

help

[resolved] Cs equivalent of (0..10).map [Answered]

Nn8ta8/16/2022
In rust I'd write smoething like (0..10).map( to iterate over a range of numbers. Obviously I can do it with a for loop but I'd prefer an IEnumerable that I can select on. I really just want to call a function 10 times and make an IEnumerable out of the results
F333fred8/16/2022
Enumerable.Range(0, 10).Select(...)
Nn8ta8/16/2022
That'll do it Thanks
F333fred8/16/2022
There's a /close command
AAccord8/16/2022
✅ This post has been marked as answered!
Nn8ta8/16/2022
Got it, next time
Mmtreit8/16/2022
You do Rust programming Nathaniel?
Nn8ta8/16/2022
@mtreit Yes outside work most of what I write is rust.
Mmtreit8/16/2022
Nice. I have dabbled with it and think it has a lot of potential if it matures well.
Nn8ta8/16/2022
I enjoy it quite a bit. Much more difficult learning curve than c# but really let's you dive into the details which I love. Definitely not the right tool for every project but a joy in the right niche.
Mmtreit8/16/2022
I've been trying to find an excuse to use it at work 🙂
Nn8ta8/16/2022
Haha someone snuck some f# into our codebase and they've never heard the end of it So I will learn from their mistake xD Definitely recommend if you have a chance to use it I've been pleasently surprised by c# (only used it here) and other than null handling I'm quite happy.

Looking for more? Join the community!

Want results from more Discord servers?
Add your server
Recommended Posts
LLVMSharp guidance neededHey, I've wrote a simple parser and lexer for my toy language and rn I'm trying to use LLVMSharp to Newtonsoft.Json errorThe error: Unhandled exception. Newtonsoft.Json.JsonWriterException: Token PropertyName in state ProReplace text in VS within scope or highlighted?I'd like to replace a specific section of text in the same way `ctrl+r+r` would but couldn't find anWPF UIElement.IsHitVisible help neededHello, In WPF `IsHitTestVisible="False"` instead of only ignoring mouse clicks, it also ignores Mouregex help [Answered]So I made a regex with little help of copilot, it looks like this: ```regex ^ (?<source>[0-7],[0-7]Using async,await in old codebaseCurrently, I'm implementing a custom control that utilizes an API, so there are some async methods. Can't use exenstion medthodHelpSet foreground back to default color using csharp```xml <TextBox Header="Name" MinWidth="250" Gdifferentiating use cases- Enum vs Tuple vs ArrayWhat are some common cases where enums are preferable to use over tuples/arrays, and vice versa? IfHow to locally loadbalance threadsafe [Answered]Hola, I got an instance of a class that holds a list of end-points. The class performs and awaits anAzure app insights api query problemHi, I trying to query application insights via api by using provided nuget package - https://github.How do to generate HTML or PDF Docs from Source annotations (summary).For a Project i look into how i could create a documentation from the annotated source. I found a feASP.NET REST APIs with Custom Error ModelsHi all. I'm currently developing a REST API and have a few questions regarding error flow, as well a❔ Any known .NET 7 implementations of an Int24?Just wondering if there's an implementation of an `Int24` type using the new signatures for the numeCombining func reference behavior [Answered]If i combine func3 += func1 and func3 += func2 and then lets say func1 += someMethod Will func3 alsoCustom JSON serializer not workingHello I have a custom serializer i cannot get to work. When I use the model in a controller, it justServiceProvider not providing registered service [Answered]For some reason, despite registering this api wrapper as so: ```cs services.TryAddScoped<IInContactRIndex NavLink not working in NavMenuI have two pages, Index and Register My navbar's `SkullDugDungeon` text should redirect to Index/HomRefactoring if elseHelp ! ```cs partial void OnNameChanging(string value) { _validationService.CleaCustom MSBuild SDK not found after uploading new versionI'm fiddling with a custom MSBuild SDK, and everything has worked fine up until now. I just tried to