---
title: "Define Partial class in MVC."  
description: "Define Partial class in MVC."  
author: "Anonymous User"  
published: 2020-01-22  
updated: 2020-01-22  
canonical: https://www.mindstick.com/forum/155717/define-partial-class-in-mvc  
category: "asp.net mvc"  
tags: ["asp.net mvc"]  
reading_time: 1 minute  

---

# Define Partial class in MVC.

please [briefly explain](https://www.mindstick.com/forum/156854/briefly-explain-the-concept-of-constructor-overloading) me about [partial class](https://www.mindstick.com/articles/31/partial-class) with some suitable example and image.

![Define Partial class in MVC.](https://www.mindstick.com/mindstickforums/eb0143ad-9f01-49bd-a1db-ae7f9ba13410/images/a7d5f27d-6cc3-4646-a612-77932b4b71d2.jpeg)

## Replies

### Reply by Nishi Tiwari

A [partial](https://www.mindstick.com/blog/78/partial-class-in-dot-net) [class](https://www.mindstick.com/blog/165/generic-class-in-c-sharp) can be defined as the class that can be split among multiple physical files. This feature came in C# 2.0. The partial class break the definition of class into two or more than two class files, but it will be together at compile time as one class.

Every class in **[C# resides in a separate physical file with a .cs extension.](https://www.mindstick.com/forum/155718/explain-requirements-and-advantages-of-partial-class)** C# provides an ability to have a single class implementation in multiple .cs files using the partial modifier keyword. The partial modifier can be applied to any class, method, interface or structure.

For example, this MyPartialClass splits into two files, PartialClassFile1.cs and PartialClassFile2.cs:

## Example:

PartialClassFile1.cs

```
public partial class MyPartialClass
{
    public MyPartialClass()
    {
    }

    public void Method1(int val)
    {
        Console.WriteLine(val);
    }
}
```

![Define Partial class in MVC.](https://www.mindstick.com/mindstickforums/eb0143ad-9f01-49bd-a1db-ae7f9ba13410/images/61873049-cfe7-45d4-b779-f8f5eb8660bd.png)\


---

Original Source: https://www.mindstick.com/forum/155717/define-partial-class-in-mvc

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
