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
1 answer

implicit conversion - strongly typed datatable to datatable?

Not sure why I'm getting this error. Project is converted from VS 2005, to VS 2008, but remains with 2.0 framework.. image of the error message Here is the interface with my generic type and constraint.... public interface ITableAdapter
where…
codeputer
  • 1,987
  • 3
  • 19
  • 45
0
votes
1 answer

Silverlight + Entity framework code first + DomainService + partial class

I have silverlight project with entityes thisis my table class public class OrderHeader : INotifyPropertyChanged { public string OrderId{get;set;} } And I have public class DataBaseContext : DbContext { public DbSet
Std_Net
  • 1,076
  • 3
  • 12
  • 25
0
votes
2 answers

How to create calculated Fields in Partial Classes - WPF

I am trying to use the calculated columns to display in my grid. I have a partial class automatically generated by EF code generator with three properties: and i am trying to creating another partial class and add calculated field there for e.g.…
0
votes
3 answers

Partial class in MyClass.xaml not recognized by partial class in MyClass.xaml.cs

I have a class, partially defined in XAML and partially in code: The file ElementResource.xaml looks like this:
Marc
  • 12,706
  • 7
  • 61
  • 97
0
votes
1 answer

Instantiate partial class : page types in ASP.NET C#

Below is an example of what I am trying to accomplish regarding instantiating partial classes in an effort to make use of multiple classes (and their methods) from a single .aspx page. login.aspx: <%@ Page Language="C#"…
Matthew2468
  • 71
  • 1
  • 7
0
votes
1 answer

Ruby on Rails: Concerning rendering partials inside paginated objects

I am really confused with how rendered paginated objects work. Take this for example: When I run <%= render :partial => 'feeds/share_item', collection: @share_items %> <%= will_paginate @share_items %> I can go to _share_item.html.erb and inside…
0
votes
2 answers

reference wcf class in mvc for data annotation validation

I have a data contract class with data members in my WCF project and I want to reference them in my MVC project so I can apply data annotation validation to them I can use the class object in my MVC project already the only problem is the…
Smithy
  • 2,170
  • 6
  • 29
  • 61
0
votes
2 answers

access and set variables in a class from another class

i'v a shopping_cart.aspx.cs file & also have a class file spcart.cs, shopping_cart.aspx.cs public partial class Ui_ShoppingCart : System.Web.UI.Page { public int tax = 0; public int subtotal = 0; public int granttotal = 0; …
Ashok Damani
  • 127
  • 2
  • 3
  • 12
0
votes
1 answer

More validation on generated Linq Entity Classes

We're using sqlmetal to generate our DBML, run it through a transformation, then use sql metal to generate the DataContext classes -- additionally, I want to automatically generate some validation for the entities based on some metadata that we…
Mustafa Shabib
  • 798
  • 12
  • 35
0
votes
1 answer

Computed property on partial POCO class prevent linq query on DbContext

Using EF 5.0 (aka 4.3) I transformed one of my pocos (which I got from reverse engeniring my database), to be a partial class in order to extend it with a computed propertry wich is not relevant in my DB but is in my application. Though, when I'm…
0
votes
1 answer

LINQ To SQL Partial Class Inherits Only One Class Without Its Relationship

I have a few LINQ to SQL entity tables which have relationships from one to another. Can anyone tell me a quick way to create a partial class that only inherits a class without its related entity included?
sovantha
  • 259
  • 3
  • 16
0
votes
2 answers

Override the setter generated in the DBML file

I want to override a setter of a property in a partial class: Partial class: public partial class User { public string Name { set { // Do something } } } but I have the following error: The type…
Anas
  • 5,622
  • 5
  • 39
  • 71
0
votes
2 answers

How to invoke object in Partial Classes by initializing constructor of partial classes?

I'm working on ASP.NET MVC3 with C#. I got an error like below Type 'Test' already defines a member called 'Test' with the same parameter types My Code is: public partial class Test { Test() { //some code } } public partial…
Krutal Modi
  • 477
  • 9
  • 25
0
votes
2 answers

Why are classes generated by EF Power Tools not partial?

I'm using Reverse Engineered Code First code and see stubs like: public class User { public User() { this.Addresses = new List
(); ... } public int ID { get; set; } ... } When, based on this question, i'd…
justSteve
  • 5,444
  • 19
  • 72
  • 137
0
votes
1 answer

Tweaking POCOs generated by EF Reverse Engineer

I'm generating POCOs from my db via EF Power Tools and am ready to start tweaking and extending them. This Q/A gets me past the initial question (how to add partials) but I wonder if the provided answer will have changed for MVC4 projects. But that…
justSteve
  • 5,444
  • 19
  • 72
  • 137