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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T05:41:22+00:00 2026-06-08T05:41:22+00:00

Is it possible while using MVCscaffolding and t4 templates to automatically generate a model

  • 0

Is it possible while using MVCscaffolding and t4 templates to automatically generate a model with all table data from database

for example i have a table named Customers in my DB
it has 3 fields:

Id
Name
Number

so can i make a t4 template that would generate something like this:
(and it would work with all the tables + fields with other names)?????

using System;
using Data.EF.Model;
using Data.ViewModels.SlickGrid;

namespace Data.ViewModels.SlickGridDemo
{
    public class CustomerGridViewModel
    {
        public Int Id { get; set; }
        public string Name { get; set; }
        public int? Number { get; set; }  
    }
}

well? anyone? is this possible?

  • 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-08T05:41:23+00:00Added an answer on June 8, 2026 at 5:41 am

    well podiluska’s answer didin’t help, so i’ve managed to create my own solution to this problem
    just remade the standart rezorview delete template so it would show me my datatypes and properties like so:

     <#
    foreach (ModelProperty property in GetModelProperties(Model.ViewDataType, true)) {  
    #>
       public <#=property.Type.AsString#> <#=property.Name#> { get; set; }   
    
    <#  
    }
    #>
    

    and that’s it, if samoone will have the same problem do the same it should work fine 🙂

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

Sidebar

Related Questions

While it is possible to generate PowerPoint presentations automatically using Office Automation , this
I am wondering if it is possible while using MAMP to have the database
Is it possible to get flex renderer recycling while using browser scrollbars? I have
All, Question 1 while using templates, Compiler error information is known to be very
While using JFrame, is it possible to have the window unable to be expanded
In a PHP environment, is it possible to have different/independent sessions while using http
Possible Duplicate: Issue while saving image using savefiledialog I use windows forms in C#.
Passing User defined argument to RPM is possible while installing?. for example: ~>rpm -i
Possible Duplicate: Modifying .NET Dictionary while Enumerating through it I have a dictionary object
Possible Duplicate: Class construction with initial values While I was looking at c++ example

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.