Questions tagged [partial-classes]

With this keyword classes can be split into multiple definitions, but it compiles into one class.

With this keyword, classes can be split into multiple (mostly two) definitions, but the code compiles into one run-time class.

References

441 questions
0
votes
2 answers

Why are partial class properties not shown on report datasource in C#?

I have a web service which I consume in a C# application. To be able to view child properties inside the class I defined a partial class like this: public class Client{ public int Id {get; set;} public int Name {get; set;} ... ] public…
user3222589
  • 184
  • 1
  • 13
0
votes
0 answers

Error when using Entity Framework partial class

I am using a partial class to add methods to a context object. namespace AddressCleansing { public partial class service { internal void Save() { Result result = new Result(); if (string.IsNullOrEmpty(AccountCode)) …
KevinManx
  • 519
  • 1
  • 5
  • 26
0
votes
1 answer

Error Trying To Call PHP Class

I am getting an error when tring to call a class I have included the class in my Site Config File. include($GLOBALS["webpath"] . "/classes/LM_com.php"); When i call for it I get An error that it cant be found. this is line 35 $loads =…
0
votes
2 answers

undefined method regular_user_path (oath object oriented approach)

I have implemented an oath object oriented approach to my rails application using this tutorial. I've also split my User Form into an Edit & Account Form. User Edit Form -Name -Username -AboutMe User Account Form -Email -Password -Password…
Serge Pedroza
  • 2,160
  • 3
  • 28
  • 41
0
votes
2 answers

Two partial classes into two files that one is sub item of the other and can be expanded

I added two partial classes that have the same name: public partial class SomePartial { } and now I have two separate files. I want to make them appear as single item in the project, that can be expanded like in a WebForms project where you have…
ilay zeidman
  • 2,654
  • 5
  • 23
  • 45
0
votes
1 answer

How we work an svc file together?

We works, two developer on a wcf service project together. But we want to work different methods, seperately at the same time on a svc file and interface ? How can we do it? Are partial classes help to us?
fcoskun
  • 23
  • 10
0
votes
1 answer

C# Entity Framework - Inheritance issue with partial classes

I'm having an issue here with Entity Framework 5 In my program I have a base class defined as below: public abstract class CoreProduct { public abstract decimal Price { get; set; } public abstract decimal CategoryID { get; set; } public…
0
votes
2 answers

User control event extension is possible?

Extend an event in a user control with out changing in the associated class (usercontrol.cs) file, add as separate class in app_code ,is that possible? Reason: I am using a CMS (Ektron), so i cant add code in usercontrol.cs file code sample: user…
Nikhil K S
  • 806
  • 1
  • 13
  • 27
0
votes
5 answers

Using partial classes to add private properties?

I have a public class I'm defining that will eventually be part of an API, so it has to have certain public properties. However, I also want some of the properties to be read-only unless they're created from within my own projects (e.g., if a user…
Adam V
  • 6,256
  • 3
  • 40
  • 52
0
votes
2 answers

C# When consuming two sets of "identical" classes from different namespaces, how do I avoid writing the same method(s) twice?

I have for example two namespaces with three classes in each namespace.These two sets of three classes are--for my purposes--identical in names and properties, but each set exists in its own namespace. As you can guess this code is generated…
Null
  • 45
  • 1
  • 12
0
votes
3 answers

Windows Form partial class resets value when declared from another form

i'm trying to create a program that works with USB devices. The problem i'm having is I have a listbox that contains each connected USB device in the computer. When you select a device, I want to open up a new form, Device_Options, which is located…
Van Man
  • 51
  • 1
  • 9
0
votes
1 answer

Are Linq associated entity collections automatically keyed?

I have an entity set that is a Session for a survey. There is a navigation property to a collection of Responses that are also keyed to an Question entity (using a foreign key relationship in the DB). It is easy for me to call up the collection of…
Scottingham
  • 906
  • 2
  • 11
  • 26
0
votes
2 answers

Partial Classes and hundred members

Apart of the atypical reasons to have classes with hundred members (eg DAO pattern to access hundred objects), what would be the best approach: Have only one class with all members or instead hundred of partial classes each one with one member ? One…
Luciano
  • 2,695
  • 6
  • 38
  • 53
0
votes
1 answer

Access Context/other EntityObjects from partial class

I need to add a new EntityObject to Context when one specific (calculated) property is changed in another EntityObject. There seems to be no access to Context from any EntityObject itself. For example, my "Employee" partial class has a custom…
Nuts
  • 2,755
  • 6
  • 33
  • 78
0
votes
2 answers

Model - Partial class and Datacontext class are not communicating

I've created a one table contact DB, which has only 3 columns (Id, Name, and Phone). I've then created the ContactsDataContext using my table Contacts in the model folder. Finally, I create a partial class still in the model folder (public partial…
Richard77
  • 20,343
  • 46
  • 150
  • 252