partial-classes Questions

4

Solved

I'm using EF Core and DatabaseFirst approach. My dbContext is created automatically by Scaffold-DbContext command. I need to add some new DbSets into a dbContext and add into OnModelCreating method...

2

files.ts export class ServiceUrls { static baseUrl: string = 'http://localhost:52949/V1/'; static baseImageUrl: string = 'http://localhost:52949/'; } filess1.ts extends interface ServiceUrls{...
Gastronome asked 11/5, 2017 at 9:42

3

Solved

Is there a way to find out whether class is partial inside Roslyn analyzer? There is a PartialImplementationPart in IMethodSymbol, but nothing similar for INamedTypeSymbol. I'm writing a Source Gen...

13

Solved

I don't think this is possible, but if is then I need it :) I have a auto-generated proxy file from the wsdl.exe command line tool by Visual Studio 2008. The proxy output is partial classes. I wa...
Monogamy asked 29/10, 2008 at 18:2

4

Solved

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 ...
Commonly asked 21/3, 2010 at 3:50

2

Solved

I have a MVC 3 site but am using the non-MVC FluentValidation dll. I've created a validator class and in the constructor put all my RuleFors and then set an attribute on my model class thus [Fluen...

6

Solved

Is there a partial specialization for template class method? template <class A, class B> class C { void foo(); } it doesn't work to specialize it like this: template <class A> ...
Adenosine asked 8/10, 2009 at 5:45

12

Solved

I am using partial classes to split some functionality between 2 files, but I am getting an error. What am I doing wrong? A1.cs: private partial class A { private string SomeProperty { get { ret...
Metalinguistics asked 8/10, 2008 at 21:16

7

Solved

I am trying to use the Extensibility Method Definitions from my datacontext.designer.cs file to do some validation. So I created a new file and added this code: public partial class LawEnforcemen...
Calumny asked 4/3, 2009 at 18:1

4

Solved

I don't think it's possible but since I haven't got a definite clarity from MSDN, I feel that it's best to ask. Suppose that we have a class as follows. public partial class Hazaa { public int Sh...
Fingerprint asked 27/12, 2015 at 13:36

9

Solved

I have a class called 'Article' in a project called 'MyProject.Data', which acts as the data layer for my web application. I have a separate project called 'MyProject.Admin', which is a web-based ...
Gamin asked 15/3, 2009 at 6:25

9

Solved

Using "new" style classes (I'm in python 3.2) is there a way to split a class over multiple files? I've got a large class (which really should be a single class from an object-oriented design persp...
Continuation asked 9/3, 2012 at 17:30

5

C# has this great concept where a class can be spread across multiple .cs files. This works great where you want a single object (member variables that all the code needs) but there's a ton of code...
Awad asked 13/12, 2013 at 22:51

7

Solved

Is it possible to have two parts (same namespace, same class name) to a partial class in separate DLLs?
Bunkum asked 4/10, 2010 at 19:57

5

Solved

I have an interface that I want to implement in separate classes after doing a quick google search apparently, Java doesn't have partial classes. Is there a way that I can do this or am I stuck th...
Oraliaoralie asked 26/3, 2012 at 16:53

6

Solved

In Entity Framework (Database first) I am trying to add some Data annotations to created classes. In general: I have class X created: namespace Info { using System; using System.Collections.Gen...
Indefinable asked 4/7, 2013 at 12:52

8

Solved

I have a class library with all my database logic. My DAL/BLL. I have a few web projects which will use the same database and classes, so I thought it was a good idea to abstract the data layer i...
Threaten asked 21/11, 2008 at 19:45

5

Solved

Is there a way I can have a generated code file like so: public partial class A { public string a { get; set; } } and then in another file: public partial class A { [Attribute("etc")...
Termination asked 23/9, 2010 at 20:43

8

Solved

I'm very new to C# so please bear with me... I'm implementing a partial class, and would like to add two properties like so: public partial class SomeModel { public bool IsSomething { get; set; ...
Lassitude asked 13/8, 2009 at 15:12

8

Solved

Consider a class which implements a lot of interfaces, would it make sense to implement each interface in a separate file using partial class definitions? Would this be an abuse of the language f...
Grubb asked 13/1, 2011 at 14:35

2

Solved

I have an auto generated class with a property on it. I want to add some data annotations to that property in another partial class of the same type. How would I do that? namespace MyApp.BusinessO...
Dodona asked 25/5, 2011 at 22:32

9

Solved

According to MSDN Documentation for partial classes : Partial methods are implicitly private So you can have this // Definition in file1.cs partial void Method1(); // Implementation in file2.cs ...
Porta asked 8/1, 2010 at 0:54

7

Is there a shortcut to jump between partial classes for the same class in the VS2012 editor? I know I can use search but I was hoping for a shortcut.
Wilkison asked 16/7, 2013 at 0:56

1

Solved

It would be great if this would work. Am I trying to implement my idea in the wrong way? I would like to use partial method, to be able to extend existing code, and simply plug in/out implementati...
Gottlieb asked 22/9, 2015 at 7:34

5

The idea behind partial classes is that you can group certain functions together. The best example of this in C# is putting control definitions in one file and the event handlers in another. In Rub...
Pinkeye asked 14/5, 2011 at 0:4

© 2022 - 2025 — McMap. All rights reserved.