partial-classes

How do I generate optimized SQL with my (added) partial methods on LINQ entities

Let's say I have a Person table with a FirstName and LastName column. I extended the Person LINQ entity class with a get property "FullName", that concatenates the first and last names. A LINQ query like: from person... select fullName where id = x generates SQL selecting all Patient columns, since FullName is evaluated after f...

How to set a value for a string in a really complicated c# partial class for a web service with xml-seriaisation? (I think)

Hi I'm new to C# and I'm using MS VS2008 Express on XP32. I have this class, auto-generated from a wsdl: public partial class PartDataSetType { private object[] partDataSetField; /// [System.Xml.Serialization.XmlArrayAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] [System.Xml.Serialization.XmlArrayItemAttribute("Entit...

Merge multiple .NET binaries together?

I want to program something in both C# and F#. I have partial classes and i would like to define F# methods in a few of them. I get the issue that a partial class can not be spanned across 2 DLLs. Is there a way i can merged them? I prefer a free solution and the ability to do it automatically in a normal build. ...

How to make user control partial classes aware of controls declared in the base class?

Do we have to do something special to have ASP.NET partial classes aware of controls that are declared in our user control's base classes? The partial classes keep generating declarations for controls in the base class which mean the controls in the base class get hidden and are null. ...

Change update value of property (LINQTOSQL)

Hi... I've got an entity object - Customer, with a property called VATRate. This VATRate is in the form of a decimal (0.25). I wanted to be able to enter a percentage value, and save it in the correct decimal value in the database, so I made this custom property: partial class Customer{ public decimal VatPercent { get{ .....

C# Partial Class and COM Interface

I'm creating a C# library and am going to expose a COM interface to it. I understand the steps requried to do this, i.e. Ensure assumbly GUID is assigned, e.g: [assembly: Guid("dde7717b-2b75-4972-a4eb-b3d040c0a182")] Ensure COMVibile attribute is True Put a GUID attribute on the class, e.g. [GuidAttribute("4df74b15-d531-4217-af7e-569...

WinForm partial classes

I have a WinForm project that contains a form called MainUI. You can see that the automatically generated partial class shows up as a node under MainUI.cs. Is there a way to "move" my self created partial class MainUI.Other.cs under MainUI.cs so that it'll show as another node? ...

mvc2 validation problem (ambiguous reference between model and models)

I followed instructions for mvc validation but I can't manage to solve this problem.... This is linq to sql model: I set Entity namespace to be CMS.Model If I try to declare partial class Article in Portal.Models namespace: public partial class Article { .... } Then, after using Article article somewhere in code I...

What's the convention for extending Linq datacontext with set based helper operations specific to one collection of entities only

Hi All I might be vaguing out here but I'm looking for a nice place to put set based helper operations in linq so I can do things like; db.Selections.ClearTemporary() which does something like db.DeleteAllOnSubmit(db.Selections.Where(s => s.Temporary)) Since I can figure out how to extend Table<Selection> the best I can do is crea...

WCF - Single Web Service Endpoint Using Partial Classes

A project I am working on requires a structure as such: {BasePrefix}/Application/{id}/Security/Users/{userId} {BasePrefix}/Application/{id}/Objects/{objectId} etc. Application.svc would be end up being my WCF Web Service. I tried to convince them to do: {BasePrefix}/Security/Application/{id}/Users/{userId} This would allow me to ha...

Python: combining making two scripts into one

I have two separately made python scripts one that makes a sine wave sound based off time, and another that produces a sine wave graph that is based off the same time factors. I need help combining them into one running file. Here's the first: from struct import pack from math import sin, pi import time def au_file(name, freq, freq1,...

Extend linq-to-sql partial class to avoid writing a property?

I have a linq-to-sql class. I have a property "Password" for which I want to call the underlying ASP.NET Membership provider. Thus, I do not want this property written out directly but via my own code. I basically want to create a facade/proxy for this property such that I may use the underlying membership provider or a custom stored pro...

Interface and partial classes

According to rule SA1201 in StyleCop elements in class must appear in correct order. The order is following: Fields Constructors Finalizers (Destructors) Delegates Events Enums Interfaces Properties Indexers Methods Structs Classes Everything is ok, except of Interfaces part, because Interface can c...

LINQtoSQL Custom Constructor off Partial Class?

Hi all, I read this question here: http://stackoverflow.com/questions/82409/is-there-a-way-to-override-the-empty-constructor-in-a-class-generated-by-linqtosq Typically my constructor would look like: public User(String username, String password, String email, DateTime birthday, Char gender) { this.Id = Guid.NewGuid(); ...

Using a part of a class in multiple projects

I have a set of methods that do some utility work over SQL connection, and until now these have been copied over from project to project. But as time goes on, project numbers have grown and I need to keep these methods in sync in case I find a bug or need to update it. I have managed to get it to the state that SQL access class is a par...

List of all domain classes in Grails

Hi there, how can I get a list of alle domain classes I use in my project? Something like GORM.domains.list()... Greetings from Germany Jan ...

ColdFusion CFC implementation of C# Partial Class?

Does ColdFusion offer a mechanism for splitting CFCs into multiple files? I am NOT talking about extension, I am talking about splitting the SAME CFC into multiple files; the same way C# allows for "partial" classes. The reason for this is because I am using T4 to generate a bunch of CFCs and I want to be able to tag functionality onto...

partial classes/partial class file

In C# .net there is a provision to have two different class files and make them a single class using the keyword partial keyword.this helps it to keep [for ex]UI and logic seperate. of course we can have two classes to achieve this one for UI and other for logic. Can this be achieved in java some how? ...

How can I extend a LINQ-to-SQL class without having to make changes every time the code is generated?

Hi, Update from comment: I need to extend linq-to-sql classes by own parameters and dont want to touch any generated classes. Any better suggestes are welcome. But I also don't want to do all attributes assignments all time again if the linq-to-sql classes are changing. so if vstudio generates new attribute to a class i have my own e...

problems with extended classes and overwrite with methods

I have a .net website written in C# and will make functionalities that other developers can use. So I will make some default implementation and a developer can overwrite some methods Example: i have a class ShoppingCart and a class Product the class product haves a method getProductPrice the shoppingcart will call the method getProductP...