partial-methods

How are partial methods used in C# 3.0?

I have read about partial methods in the latest C# language specification, so I understand the principles, but I'm wondering how people are actually using them. Is there a particular design pattern that benefits from partial methods? ...

¿Cómo programar las extensiones Partial que Linq to SQL autogenera?

Hice una clase desde la herramienta Linq to SQL Clasees con VS 2008 SP1 Framework 3.5 SP1, en este caso extendí el Partial partial void UpdateMiTabla(MiTabla instance){ //Logica de negocio // Reglas de validación etc. } Mi problema es que cuando le doy db.SubmitChanges() si va al metodo UpdatemiTabla y hace las validaciones, pe...

Workaround for VB.NET partial method using CodeDom?

I know CodeDom doesn't support partial methods, but is there a workaround? I found a workaround for C#, but I need one for VB.NET. Thanks. ...

How to add a partial method without an implementation using CodeDom

internal List<CodeMemberMethod> createEventHooks() { string[] eventNames = new string[] { "OnUpdate", "OnInsert", "OnDelete", "OnSelect", "OnSelectAll" }; List<CodeMemberMethod> eventHooks = new List<CodeMemberMethod>(); foreach (string eventName in eventNames) { Co...

How can I check to see if poco entity framework object has been materialized?

I am using EF4 poco objects and I have changed my t4 template to add a partial method for every property. The partial method is called in the setter. When the objects are materalized the code in the setter gets ran and therefore my code gets ran. I do not want my code to get ran with the objects are being materialized. The way to do ...

C# Why can partial methods use ref, but not out?

Pretty straight forward. MSDN states that you can use ref, but not out for partial methods. I'm just curious as to the why? It was my understanding that when code is compiled, the partials are merged, so what is up with the restriction? Is there more to partial than just making code files cleaner and organized (i.e. eyecandy)? Reference...

Why you need partial methods in c#? Can events be used to achieve the same goal?

I was reading the book "Apress Pro LINQ: Language Integrated Query in C#" and I came across partial methods, but I really don't understand what is the need for them. I think the examples in the book (properties before and after change) can be implemented using events. So any explanation? ...