C
C#2y ago
Hugh

✅ Sharing a Func alias between files

Hi all, I've currently got the following at the top of 2 different files:
using MyFunc = Func<string, string, int, float, string>;
using MyFunc = Func<string, string, int, float, string>;
Because it's a using, as I understand it, it's only available to that one file. How can I do something where I only define this function type in one place, and can use it in multiple files?
2 Replies
sibber
sibber2y ago
define a delegate (or using global, but id define a delegate)
Hugh
Hugh2y ago
Thanks - will go with the delegate using global sounds like something I'd really rather avoid
Want results from more Discord servers?
Add your server
More Posts
❔ Is there a way to access a prop with the help of a string.Is there a way to access a prop with the help of a string. Like you do in JS like this ``myObject["p✅ httpclient get download stream in blazori have this code to download a file from remote source (about 100 MB). ``` HttpRequestMessage reques❔ ILogger is never enabledAny idea what's going on here? https://github.com/dotnet/runtime/issues/80336 ``` using Microsoft.❔ is it possible to make cursor smooth caret animation in a textbox in vs?I just wanted to know because I'm making a web browser and I saw cursor smooth caret animation and I❔ Hi i need wpf helpim following this article https://wpf-tutorial.com/xaml/events-in-xaml/ and i want to know why doesn❔ Is a generic with a where clause equivalent to passing the same type through as a parameterIs there any difference between the following 2 methods? public void DoSomething<T>(T value) where ❔ Only one compilation unit can have top level statements err simple explanationwhen I create another cs file in the same folder I get this error, I just want to know how can I mak✅ 3 objects inheritance thing + force call base.DoThing();So I want to make Class3 inheriting Class2 inheriting abstract Class1, to have Class1's function. Ve❔ How do i assign or change Z order of a button? (Dock buttons)I'm trying to make a list of buttons appear, and dock them top down to a grid in C#. As with most t❔ .NET Framework reference vs NuGet?Hello! In a .NET-framework project I'm working in there are references to .NET assemblies both as re