Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8009743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:31:59+00:00 2026-06-04T18:31:59+00:00

This is my interface interface IBase { string MvrId { get; set; } string

  • 0

This is my interface

    interface IBase
{
    string MvrId { get; set; }
    string IndividualFullName { get; set; }
    string FirstHospitalCaseNumber { get; set; }
}

I have a class

public class AddMedicineModel:IBase
{
    private MedicalVarianceEntities DbCtx = new MedicalVarianceEntities();
    public AddMedicineModel(int MvrId)
    {

        Mvr Mvr = DbCtx.Mvrs.Find(MvrId);
        this.MvrId = Mvr.PKMvrId.ToString();//for display purposes
        IndividualFullName = Mvr.IndividualLastName 
                             + ", " 
                             + Mvr.IndividualFirstName;
        FirstHospitalCaseNumber = Mvr.CaseNumber.ToString();

    }


    //IBASE INTERFACE IMPLEMENTATION 
    public string MvrId { get; set; }
    public string IndividualFullName { get; set; }
    public string FirstHospitalCaseNumber { get; set; }
}

Here is my partial view! NOTICE THAT MY Partial view is not attached to my AddMedicineModel

Therefore, I cant re-use it with other models that inherit from IBase.How can I make a re-usable partial view for many models.

@model MedicalVariance.Models.ViewModels.AddMedicineModel
     @Html.DisplayFor(model => model.MvrId)
     @Html.DisplayFor(model => model.IndividualFullName) 
     @Html.DisplayFor(model => model.FirstHospitalCaseNumber)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T18:32:00+00:00Added an answer on June 4, 2026 at 6:32 pm

    Just declare it as taking the interface:

    @model IBase
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given this: Interface IBase {string X {get;set;}} Interface ISuper {string Y {get;set;}} class Base
I have this interface: public interface IValidationCRUD { public ICRUDValidation IsValid(object obj); private void
I have this interface: public interface Command<T> { T execute(String... args); } it works
Say I've got this interface: public interface IFoo { string Text {get;} } And
I have this interface and a class implementing it: interface Scraper { string DateToUrl(DateTime
I'm looking at this: public interface IAjaxCallbackEventHandler : ICallbackEventHandler { string CallbackResponse { get;
I have this interface public interface TestInterface { [returntype] MethodHere(); } public class test1
I have this interface... public interface ICheckThatDocumentExistsCommand { bool Execute( string userId, string docId
I started with this: interface IFoo { string X { get; set; } }
Say I have a class like this: @interface MyAwesomeClass : NSObject { @private NSString

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.