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
0 answers

Entity Framework overwriting custom properties

In Entity framework, I have to add more properties to the auto generated properties in the Entity Framework. Is there is any way we can stop the EF to stop over writing these properties, when we regenerate the Entities. In Entity Framework I am…
0
votes
2 answers

Shared source folders as an alternative to class libraries in C#

I'm wondering if its possible to set up and share an entire folder of source code between multiple projects in Visual Studio 2012 like how eclipse lets you use multiple source folders. I'm currently developing an entity framework model for a game…
0
votes
2 answers

How do I make custom XAML and CS partial classes with inheritance?

I have researched this pretty thoroughly and found this, this, and this. All of the help pages that I've found say pretty much the same thing. It's not very complicated, so I'm pretty sure I've done it right but that the behind the scenes files are…
unwrittenrainbow
  • 473
  • 1
  • 7
  • 15
0
votes
0 answers

How to let EF automatically generate some data in a partial class before the destruction of a context

I have a complicated structure of tables and I need some work done extra so I am using partial classes on my entities from EF. Lets say I have an entity called Person with attributes Name and LastName. Querying over the entity will return me a…
user853710
  • 1,715
  • 1
  • 13
  • 27
0
votes
3 answers

Nested link_to_function/insert_html does not work

Here is a simple example of the problem. http://gist.github.com/235729 In short, if you have a index.rhtml with: <%= link_to_function "A link to insert a partial with nested insert_html" do |page| page.insert_html :top,…
0
votes
1 answer

Brand new WPF Application, MVVM, and how to use POCO partical classes generated from ADO Entity Data Model....?

I've asked this before, but I actually still needed help... Here's the scenario: I'm starting a new WPF application, and want to use MVVM. Because our DBA has created a database with tables we need to perform CRUD operations on, I used the Database…
0
votes
1 answer

fluentvalidation for partial class

I have a customer class like this: [Validator(typeof(CustomerValidator))] public partial class Customer { public string FirstName { get; set; } public string LastName { get; set; } } And my Validation class is: public class…
0
votes
1 answer

Entity Framework add property to partial class that will get model or list of models from database

I have added a property to a partial class of a model. This property will retrieve a model from database according to property value. Example: class movie { int language; } partial movie { public Language SpokenLanguage { get …
0
votes
0 answers

How can I add a way to track a collection of entities and flag them on/off (to signal if a process has been done to them)?

My first idea is extend the partial class 'Step' which is an entity. I could add a bool property and then set that true/false as I complete processing on them.. But then every time I regenerate the DBContext after making changes to the DB won't I…
punkouter
  • 5,170
  • 15
  • 71
  • 116
0
votes
3 answers

Entity Framework and partial method

in my Entity Framework model, I have that column [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)] [DataMemberAttribute()] public Nullable CanShow { get { …
Tony
  • 12,405
  • 36
  • 126
  • 226
0
votes
2 answers

Can I pass a type argument to a *.xaml.cs class?

I want to pass a type parameter to my *.xaml.cs file. The C# code will look like this: public partial class Filter : Window where T : IFilterableType { private readonly IEnumerable _rows; public Filter(IEnumerable rows) { …
user2023861
  • 8,030
  • 9
  • 57
  • 86
0
votes
2 answers

Assembly name in Entity Framework and Partial Classes

Where in .edmx-file I can find the assembly name? Second, when I create my own partial class, how do I make it to appear in the same assembly?
Nuts
  • 2,755
  • 6
  • 33
  • 78
0
votes
1 answer

return values from a class

How can i return a value from a a function in a Sealed Partial class? I use the usercontrols like this. I have a usercontrol that calls another one that is a list. When i selected a row from this list, i call …
0
votes
2 answers

MVC Partial Controls

Ok I have a menu system with a menu (Dynamicly Generated from a datavbase field) I want to include this menu system on several views - All of which use differant controllers and models.
LiamB
  • 18,243
  • 19
  • 75
  • 116
0
votes
1 answer

Partial Class with Virtual Properties?

Is it possible to have virtual properties within a partial class? In my scenario, we have auto-generated classes that are used by our Micro-ORM and map exactly to our database tables. We often wish to extend these classes, however, so using partial…
pierre
  • 1,235
  • 1
  • 13
  • 30