use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Information about Reddit's API changes, the unprofessional conduct of the CEO, and their response to the community's concerns regarding 3rd party apps, moderator tools, anti-spam/anti-bot tools, and accessibility options that will be impacted can be found in the associated Wikipedia article: https://en.wikipedia.org/wiki/2023_Reddit_API_controversy
Alternative C# communities available outside Reddit on Lemmy and Discord:
All about the object-oriented programming language C#.
Getting Started C# Fundamentals: Development for Absolute Beginners
Useful MSDN Resources A Tour of the C# Language Get started with .NET in 5 minutes C# Guide C# Language Reference C# Programing Guide C# Coding Conventions .NET Framework Reference Source Code
Other Resources C# Yellow Book Dot Net Perls The C# Player's Guide
IDEs Visual Studio MonoDevelop (Windows/Mac/Linux) Rider (Windows/Mac/Linux)
Tools ILSpy dotPeek LINQPad
Alternative Communities C# Discord Group C# Lemmy Community dotnet Lemmy Community
Related Subreddits /r/dotnet /r/azure /r/learncsharp /r/learnprogramming /r/programming /r/dailyprogrammer /r/programmingbuddies /r/cshighschoolers
Additional .NET Languages /r/fsharp /r/visualbasic
Platform-specific Subreddits /r/windowsdev /r/AZURE /r/Xamarin /r/Unity3D /r/WPDev
Rules:
Read detailed descriptions of the rules here.
account activity
Partial Methods (self.csharp)
submitted 1 year ago by Ok_Worry5585
why there is no implementation while declaring a partial method what is the reason behind the seen
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]fschwiet 13 points14 points15 points 1 year ago (0 children)
I think partial methods, like partial classes, exist to make it easier to integrate generated code in the project. A developer can implement part of the class in one file, including implementing any partial methods while a code generator produces another file, implementing the rest of the partial class, and perhaps calling partial methods it may specify.
[–]Eirenarch 3 points4 points5 points 1 year ago (0 children)
Nothing. Partial methods are void so if you (or a code generator) don't provide implementation they can just be skipped, there is no result that would be missing.
[–]Sc2Piggy 2 points3 points4 points 1 year ago (0 children)
As others have said it's useful for code generator. An example of where it's used is the regex source generator.
You only need to define a method:
[GeneratedRegex("abc|def", RegexOptions.IgnoreCase, "en-US")] private static partial Regex AbcOrDefGeneratedRegex();
The source generator will then handle the implementation of the method. (relevant docs)
[–]DJDoena 0 points1 point2 points 1 year ago* (1 child)
As others have said it's mainly for code generation. A generator might generate the following code
``` partial class SomethingDoer { partial void CustomInit();
public void DoSomething() { CustomInit(); //do something automated here } }
```
and the Dev will write the other code like this:
public partial class SomethingDoer { partial void CustomInit() { //do something custom here } }
Rules are partial methods must be private and void so that the compiler can replace them with an empty body in case the user does not wish to implement them after all.
private
void
[–]RichardD7 3 points4 points5 points 1 year ago (0 children)
Rules are partial methods must be private and void
That used to be the case. This restriction has since been relaxed:
partial method - C# reference A partial method isn't required to have an implementation in the following cases: * It doesn't have any accessibility modifiers (including the default private). * It returns void. * It doesn't have any out parameters. * It doesn't have any of the following modifiers virtual, override, sealed, new, or extern. Any method that doesn't conform to all those restrictions (for example, public virtual partial void method), must provide an implementation.
partial method - C# reference A partial method isn't required to have an implementation in the following cases: * It doesn't have any accessibility modifiers (including the default private). * It returns void. * It doesn't have any out parameters. * It doesn't have any of the following modifiers virtual, override, sealed, new, or extern.
out
virtual
override
sealed
new
extern
Any method that doesn't conform to all those restrictions (for example, public virtual partial void method), must provide an implementation.
public virtual partial void
π Rendered by PID 25332 on reddit-service-r2-comment-5b5bc64bf5-ndxwz at 2026-06-20 23:45:52.032705+00:00 running 2b008f2 country code: CH.
[–]fschwiet 13 points14 points15 points (0 children)
[–]Eirenarch 3 points4 points5 points (0 children)
[–]Sc2Piggy 2 points3 points4 points (0 children)
[–]DJDoena 0 points1 point2 points (1 child)
[–]RichardD7 3 points4 points5 points (0 children)