Category: .net

What are extension-methods — and what makes them different from other methods?

This question already has an answer here: What are Extension Methods? 5 answers Usage of Extension Methods 9 answers What Advantages of Extension Methods have you found? [closed] 30 answers So I run into the term “extension-methods” frequently, when reading about .Net and intellisensing (!) around… What are extension-methods — and what sets them apart […]

LINQ to SQL partial class OnValidate Changeaction.Delete

I have a LINQ partial class: public partial class resp { public IEnumerable<RuleViolation> GetRuleViolations() { if (String.IsNullOrEmpty(respName)) yield return new RuleViolation(“Responsibility name required”, “respName”); yield break; } public bool IsValid { // Quick method for checking to see whether an object contains any RuleViolations get { return (GetRuleViolations().Count() == 0); } } partial void OnValidate(ChangeAction […]