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 8721915
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:18:02+00:00 2026-06-13T07:18:02+00:00

I have the Client class defined. I also have Mapping\ClientMap.cs file that defines column

  • 0

I have the Client class defined. I also have Mapping\ClientMap.cs file that defines column names using Fluent API. However, I am not sure how to “invoke” it as I don’t see the ClientMap.cs code being executed.

I also have this:

namespace CardNumbers.Data
{
    public class Repository : DbContext, IRepository
    {
        public DbSet<Client> Clients { get; set; }
        public DbSet<ClientOrder> ClientOrders { get; set; }
        public DbSet<Reorder> Reorders { get; set; }
        public DbSet<Operator> Operators { get; set; }

which I know is not a very good practice, but that’s how we were building the application with the instructor.

So, my question is – what do I need to add to make sure the Fluent API code is invoked in run-time?

Thanks in advance.

  • 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-13T07:18:03+00:00Added an answer on June 13, 2026 at 7:18 am

    The fluent mapping should be added at the bottom of your “Repository” class like this

    protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            //add fluent api code
        }
    

    The reason I am quoting your Repository is that you are not really implementing a repository pattern there. You should really have this defined as a specific DbContext, and then have a repository which can take multiple contexts. See this very well written post about implementing a repository: http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/implementing-the-repository-and-unit-of-work-patterns-in-an-asp-net-mvc-application

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Client class like that: public class Client { public Person Pers
If I have a Client domain class, and that Client hasMany Courses. How do
I have a class Client like that: public class Client { public Person Pers
In a client application I have a DBIx::Class model 'Todo' that can be linked
I have a web service client that has an Authenticator class. The Authenticator requires
Per a client's request I have written a communication class that inherits from webclient.
Using Silverlight 3 and RIA Services I have the following class defined in my
Hope I'm asking this correctly: I have a project Projects.Client I have my class
so... I have a simple chat client like so: class ChatClient(sleekxmpp.ClientXMPP): def __init__(self, jid,
I have a server class which connects a client on a specific server socket

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.