Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
Object-oriented programming is a programming paradigm using "objects": data structures consisting of data fields and methods together with their interactions.
0
votes
Implement IDisposable correctly using object composition principle
I agree with vvotan's points that this utility could be useful, not much but still. However, I'd go further with the implementation. This means it should be separated into two disposers: Managed & Unm …
3
votes
Accepted
Convert to dictionary
Here're are my suggestions:
Remove ConverterContract and ConverterActCompletion These two classes are unnecessary wrappers to hide the inner converter. You're saying that you're doing this to hide …
2
votes
Accepted
Prepare and export data to MS Word file
My observations...
Leave generated classes alone You have modified Contracts by adding a custom constructor to it. You'll loose this changes when you regenerate the model. This class is partial not w …
3
votes
Generic wrapper for single value or array of values
Compiler error Unless you're using some experimental preview C# version, your code doesn't compile as this line:
Value = singleValue ?? throw new ArgumentNullException(nameof(singleValue));
yield …
1
vote
Collecting data into objects and POSTing to 3rd Party API
Use Dataflow
You could use the ActionBlock from the System.Threading.Tasks.Dataflow package to let it handle the throttling of InitalizeSenderAsync method that you currently handle yourself:
var wor …
2
votes
Accepted
Page-by model of data output and search results with values for UI
Inheritance
the point of inheritance and abstract base classes or interfaces is to have a common API that each type implements in its own way. Your inhertiance model doesn't do that. Classes that ar …
4
votes
C# classes for adding form components dynamically
The code is not entirely wrong but it's not appealing either. Here are a couple of thoughts:
In general I'd say this is ok and as far as WinForms are concerned not. Each of the abstract classes shou …
4
votes
Accepted
Service for generating faked objects
public interface IFaker<T> where T : class
{
Faker<T> GetFaker();
}
I don't think you need this interface and the additional call to GetFaker. Instead you can derive your class from the Faker< …
1
vote
Get collection of objects from CSV string and vise-versa
throw new System.NullReferenceException("No CSV string has passed in the parameter");
You should not be throwing this excepiton in the BuildObject method (actually nowhere). It's not only that it …
4
votes
Generic Null/Empty check for each property of a class
@Adriano Repetti was faster with his list of issues ;-) so I'll just post an alternative soltuion where you can have everyting in only one linq query using the All extension. It will stop as soon as s …
3
votes
Accepted
Custom enumeration classes
Review
IEquatable<T>
protected bool Equals(Enumeration other)
{
return string.Equals(Name, other.Name) && Value == other.Value;
}
Two things about this method...
If you implemented it, do …
2
votes
ObjectManager - Single Instance Object managerment
Witout questioning your design here are a couple of improvements you can make.
var obj = new T();
In your case creating this dummy and not actually used objects may hurt performance because you …
1
vote
Accepted
Calculating average between all times to receive a response
It's actually not uncommon that you have both the interface and a class that implements it the way you did it.
In order to make the interface reusable for both case you need to make use of generics a …
1
vote
Accepted
News-reading application using the Observer pattern
I think in general your implementation is fine. You could however use the intefaces that are already provided by .NET:
IObservable<T>
Defines a provider for push-based notification.
IObserver<T …
5
votes
Accepted
Nested Classes in C#
Is this the right way or is there an easier, smaller way to archive this?
It depends on how you define the right way. Is your goal short and small code or is your goal testability and maintainabi …