News:

SQL Table To C# Entity Model ConverterEntity Model (Class Properties) to SQL Table ConverterIf you encounter any trouble visiting our site, please contact us.

Advertisement

Looking for job. Try JobLoader- First ever job search engine in Bangladesh. All open bd jobs now a single mouse click away.

;
Entity Model (Class Properties) to SQL Table Converter

 
Example:
Step 1.a: Copy model class or only properties form .cs file like below.
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Exam.Data.Settings
{
    public class Source
    {       
        [Key]
        public int SourceId {get; set;}
        [Required(ErrorMessage = "Source is Required")]
        [StringLength(450, ErrorMessage = "Maximum length is {1}")]
        [Display(Name = "Source Name")]

        public string SourceName { get; set; }
        [Display(Name = "Active Status")]
        public bool ActiveStatus {get; set;}
        public bool RecordStatus {get; set;}

        [Display(Name = "Created By")]
        public int CreatedBy { get; set; }
        [Display(Name = "Created Date")]
        public DateTime CreatedDate { get; set; }
        [Display(Name = "Updated By")]
        public int? UpdatedBy { get; set; }
        [Display(Name = "Updated Date")]
        public DateTime? UpdatedDate { get; set; }
    }
}
                 
Step 1.b: Or you can only copy properties with class like below or full text like above.
    public class Source
    {       
        [Key]
        public int SourceId {get; set;}
        [Required(ErrorMessage = "Source is Required")]
        [StringLength(450, ErrorMessage = "Maximum length is {1}")]
        [Display(Name = "Source Name")]
        public string SourceName { get; set; }

        [Display(Name = "Active Status")]
        public bool ActiveStatus {get; set;}
        public bool RecordStatus {get; set;}

        [Display(Name = "Created By")]
        public int CreatedBy { get; set; }
        [Display(Name = "Created Date")]
        public DateTime CreatedDate { get; set; }
        [Display(Name = "Updated By")]
        public int? UpdatedBy { get; set; }
        [Display(Name = "Updated Date")]
        public DateTime? UpdatedDate { get; set; }
    }
            
Step 3: Click the "Generate" Button, Then your table script will be generated like below.
CREATE TABLE Source
( 
   SourceId int not null IDENTITY(1,1) PRIMARY KEY,
   SourceName nvarchar(450) not null,
   ActiveStatus bit not null,
   RecordStatus bit not null,
   CreatedBy int not null,
   CreatedDate datetime not null,
   UpdatedBy int,
   UpdatedDate datetime,
)
            
comments powered by Disqus
Advertisement

BCS Preparation now even more easy. ReadBD is the place where you can find all kind of resources to be successful in BCS,Bank,Islami Bank exam and interview.

Looking for job. Try JobLoader- First ever job search engine in Bangladesh. All open bd jobs now a single mouse click away.

;